All Projects → BurakGur → google-one-tap

BurakGur / google-one-tap

Licence: other
Google One Tap Login

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to google-one-tap

springboot-mongodb-security
Spring Boot, Security, and Data MongoDB Authentication Example
Stars: ✭ 22 (-40.54%)
Mutual labels:  signup, login, signin
react-signin-form
Concept for Sign in / Sign Up form
Stars: ✭ 109 (+194.59%)
Mutual labels:  signup, login, signin
Fsvideoview
An easy video playback view for iOS
Stars: ✭ 14 (-62.16%)
Mutual labels:  signup, login
Splashloginsignup
Source code for the Splash, Login and Signup Screen for Android | UI to Code - Timelapse YouTube Video
Stars: ✭ 69 (+86.49%)
Mutual labels:  signup, login
Amloginsignup
Login/Signup ViewController for iOS
Stars: ✭ 215 (+481.08%)
Mutual labels:  signup, login
SignInSignupScreen-Android
SignIn and SignUp in android 😊😊😉
Stars: ✭ 51 (+37.84%)
Mutual labels:  signup, signin
PHP-MySQL-User-Signup-Login-API
This step by step tutorial will guide you to setup up Login + Signup API using Core PHP + MySQL following best practices with folders structure
Stars: ✭ 58 (+56.76%)
Mutual labels:  signup, login
Fraternate
Fraternate is a standalone copy of the GitHub organization and user interaction framework. Built with Mongo dB | Node.js® | Express.js | Handlebars.js | Bootstrap.
Stars: ✭ 130 (+251.35%)
Mutual labels:  signup, login
sign-up-flutter
No description or website provided.
Stars: ✭ 22 (-40.54%)
Mutual labels:  signup, signin
verify-apple-id-token
Verify the Apple id token on the server side.
Stars: ✭ 49 (+32.43%)
Mutual labels:  login, signin
react-linkedin-login-oauth2
Easily get Authorization Code from Linked In to log in without redirecting.
Stars: ✭ 83 (+124.32%)
Mutual labels:  login, signin
AppleSignIn
Library for fast an easy way to implement Apple Sign In.
Stars: ✭ 19 (-48.65%)
Mutual labels:  login, signin
django-sitegate
Reusable application for Django to ease sign up & sign in processes
Stars: ✭ 32 (-13.51%)
Mutual labels:  signup, signin
Node-js-functionalities
This repository contains very useful restful API's and functionalities in node-js containing many important tutorial code for mastering node-js, all tutorials have been published on medium.com, tutorials link is given below
Stars: ✭ 69 (+86.49%)
Mutual labels:  signup, login
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+808.11%)
Mutual labels:  signup, login
ReactSignupLoginComponent
The React SignupLogin Component is a drop in login/register/forgotPassword component to speed up development.
Stars: ✭ 30 (-18.92%)
Mutual labels:  signup, login
Robin
🐧 Android login, made simple
Stars: ✭ 105 (+183.78%)
Mutual labels:  signup, login
Supertokens Core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Stars: ✭ 2,907 (+7756.76%)
Mutual labels:  login, signin
Django Rest Registration
User-related REST API based on the awesome Django REST Framework
Stars: ✭ 240 (+548.65%)
Mutual labels:  signup, login
vue-apple-signin
A simple Vue plugin to include an Apple sign-in button into your web app.
Stars: ✭ 19 (-48.65%)
Mutual labels:  login, signin

Google One Tap Login

Demo (Nextjs): https://google-one-tap-taupe.vercel.app

Sign up users with a single tap and keep them signed in automatically.

Install

npm install google-one-tap --save

How to use

React

import googleOneTap from 'google-one-tap';

const options = {
	client_id: '___CLIENT_ID___', // required
	auto_select: false, // optional
	cancel_on_tap_outside: false, // optional
	context: 'signin', // optional
};

googleOneTap(options, (response) => {
	// Send response to server
	console.log(response);
});

Vue

import googleOneTap from 'google-one-tap';
export default {
	mounted() {
		const options = {
			client_id: '___CLIENT_ID___', // required
			auto_select: false, // optional
			cancel_on_tap_outside: false, // optional
			context: 'signin', // optional
		};
		googleOneTap(options, (response) => {
			// Send response to server
			console.log(response);
		});
	},
};

Options

Name Type Required Description
client_id String true Your application's client ID
auto_select Boolean false Enables automatic selection.
cancel_on_tap_outside Boolean false Cancels the prompt if the user clicks outside the prompt.
context String false The title in the One Tap prompt.
Allowed parameters: "signin", "signup", "use"
login_uri URL false The URL of your login endpoint.
The Sign In With Google button redirect UX mode uses this attribute.
prompt_parent_id String false The DOM ID of the One Tap prompt container element
nonce String false A random string for ID tokens
state_cookie_domain String false If you need to call One Tap in the parent domain and its subdomains,
pass the parent domain to this field so that a single shared cookie is used.
ux_mode String false The Sign In With Google button UX flow
Allowed parameters: "redirect", "popup"
allowed_parent_origin String-Array false The origins that are allowed to embed the intermediate iframe.
One Tap will run in the intermediate iframe mode if this field presents.
itp_support Boolean false Enables upgraded One Tap UX on ITP browsers.

Server

Using one of the Google API Client Libraries (e.g. Java, Node.js, PHP, Python) is the recommended way to validate Google ID tokens in a production environment.

npm install google-auth-library --save

Node.js

const { OAuth2Client } = require('google-auth-library');
const client = new OAuth2Client(CLIENT_ID);
async function verify() {
	const ticket = await client.verifyIdToken({
		idToken: token,
		audience: CLIENT_ID, // Specify the CLIENT_ID of the app that accesses the backend
		// Or, if multiple clients access the backend:
		//[CLIENT_ID_1, CLIENT_ID_2, CLIENT_ID_3]
	});
	const payload = ticket.getPayload();
	const userid = payload['sub'];
	// If request specified a G Suite domain:
	// const domain = payload['hd'];
}
verify().catch(console.error);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].