NYYU Logo
APIOAuth2

OAuth2 API Overview

Complete guide to OAuth2 social login configuration and authentication types

OAuth2 API

Integrate social login providers with comprehensive OAuth2 authentication system

Overview

The OAuth2 API enables you to configure and manage social login integrations with various providers like Google, Facebook, GitHub, and more. This system handles authentication flows, user information retrieval, and secure token management.

Core Types

OAuth2Registration

🔐
OAuth2Registration Type
Configuration for OAuth2 social login providers
type OAuth2Registration {
  registrationId: String!
  clientId: String
  clientSecret: String
  clientAuthenticationMethod: String
  authorizationGrantType: String
  redirectUriTemplate: String
  scope: [String]
  authorizationUri: String
  tokenUri: String
  userInfoUri: String
  userNameAttributeName: String
  jwkSetUri: String
  clientName: String
}
Core Fields
registrationId - Unique provider identifier
clientId - Application client ID
clientSecret - Application secret key
clientName - Provider display name
Authentication
clientAuthenticationMethod - Auth method
authorizationGrantType - Grant type
scope - Permissions requested
Endpoint URLs
authorizationUri - Authorization endpoint
tokenUri - Token exchange endpoint
userInfoUri - User info endpoint
jwkSetUri - JSON Web Key Set URI
Configuration
redirectUriTemplate - Callback URL template
userNameAttributeName - Username field

Supported Providers

🌐
Popular OAuth2 Providers
Configure any standard OAuth2 provider
G
Google
Login with Google accounts, access profile and email
F
Facebook
Authenticate users with Facebook, retrieve user profile information
Gh
GitHub
Developer-focused authentication with GitHub accounts
T
Twitter / X
Login with Twitter/X accounts and access basic profile

OAuth2 Flow

🔄
Authentication Flow
Standard OAuth2 authorization code flow
1
Authorization Request

User clicks social login button and is redirected to provider's authorization page

2
User Consent

User grants permissions and approves requested scopes

3
Authorization Code

Provider redirects back with authorization code

4
Token Exchange

Backend exchanges code for access token at token endpoint

5
User Information

Retrieve user profile from provider's user info endpoint

6
Session Creation

Create or link user account and establish authenticated session

Example Configuration

⚙️
Google OAuth2 Configuration
Example provider setup
{
  "registrationId": "google",
  "clientId": "217015743019-arfgls5skjg3tehl67gf8sitbf0rq9k9.apps.googleusercontent.com",
  "clientSecret": "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",
  "clientAuthenticationMethod": "BASIC",
  "authorizationGrantType": "authorization_code",
  "redirectUriTemplate": "{baseUrl}/oauth2/callback/{registrationId}",
  "scope": ["openid", "profile", "email", "address", "phone"],
  "authorizationUri": "https://accounts.google.com/o/oauth2/v2/auth",
  "tokenUri": "https://www.googleapis.com/oauth2/v4/token",
  "userInfoUri": "https://www.googleapis.com/oauth2/v3/userinfo",
  "userNameAttributeName": "sub",
  "jwkSetUri": "https://www.googleapis.com/oauth2/v3/certs",
  "clientName": "Google"
}

Key Features

🔒
Secure Authentication

Industry-standard OAuth2 protocol with secure token handling

🌍
Multi-Provider Support

Configure multiple social login providers simultaneously

👤
User Profile Sync

Automatically retrieve and sync user information from providers

🔑
Flexible Scopes

Request specific permissions based on your application needs

Available Endpoints

📡
OAuth2 API Operations
Manage provider configurations and authentication
Send Request for Social Login

Initiate OAuth2 authorization flow with provider-specific authorization URL

Add & Update Social Sites

Configure and manage OAuth2 provider registrations (Admin only)

🚀
Ready to integrate?
Explore our OAuth2 documentation to start adding social login to your application