Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
An auth library for react to login with google and github. It works with redirect url to get the code and then exchange it for the access token with your server side api to get the user details.
To install the package, run:
npm install authify
To use the Google login button:
GoogleLoginButton
component in your React application:import React from 'react';
import GoogleLoginButton from 'authify/GoogleLoginButton';
const App = () => {
const handleSuccess = (response) => {
console.log('Google login success:', response);
};
const handleFailure = (error) => {
console.error('Google login failure:', error);
};
return (
<div>
<GoogleLoginButton
googleClientId="YOUR_GOOGLE_CLIENT_ID"
redirectUri="{base_url}/oauth-redirect"
onSuccess={handleSuccess}
onFailure={handleFailure}
variant="custom" // or "renderedButton"
>
Login with Google
</GoogleLoginButton>
</div>
);
};
export default App;
Create public/oauth-redirect.html
:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>OAuth Redirect</title>
<link rel="stylesheet" href="/path/to/your/styles.css" />
</head>
<body>
<div id="root">Redirecting...</div>
<script>
window.onload = function () {
const params = new URLSearchParams(window.location.search);
const code = params.get('code');
const error = params.get('error');
if (code) {
window.opener.postMessage({ code }, window.location.origin);
} else if (error) {
window.opener.postMessage({ error }, window.location.origin);
}
window.close();
};
</script>
</body>
</html>
To use the GitHub login button:
GitHubLoginButton
component in your React application:import React from 'react';
import GitHubLoginButton from 'authify/GitHubLoginButton';
const App = () => {
const handleSuccess = (response) => {
console.log('GitHub login success:', response);
};
const handleFailure = (error) => {
console.error('GitHub login failure:', error);
};
return (
<div>
<GitHubLoginButton
githubClientId="YOUR_GITHUB_CLIENT_ID"
redirectUri="http://localhost:3000/oauth-redirect"
onSuccess={handleSuccess}
onFailure={handleFailure}
variant="custom" // or "renderedButton"
>
Login with GitHub
</GitHubLoginButton>
</div>
);
};
export default App;
We welcome contributions! If you would like to contribute, please follow these steps:
git checkout -b feature/YourFeature
).git commit -am 'Add some feature'
).git push origin feature/YourFeature
).We encourage contributions for adding support for other providers, improving documentation, and fixing bugs. If you find this project helpful, please give it a star on GitHub to help others discover it!
FAQs
An auth library for react to login with google and github. It works with redirect url to get the code and then exchange it for the access token with your server side api to get the user details.
The npm package oauthify receives a total of 5 weekly downloads. As such, oauthify popularity was classified as not popular.
We found that oauthify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.