GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version

Use OIDC authorization code mode

1

Splice login authorization link

Splice login authorization link and guide users to click
2

Jump to GenAuth for authentication

Guide users to click the login link and jump to GenAuth for authentication
3

Handle callback

Use the authorization code code in the backend to exchange for AccessToken and IdToken
4

Complete authentication

The server authenticates the user and executes the subsequent process
Splice login authorization link

You need to splice a login URL for users to click on, so as to jump to the authentication page.

Select language
JavaScript
Loading...
// Initialize authing-js-sdk
const authenticationClient = new AuthenticationClient({
  appId: "GEN_AUTH_APP_ID",
  appHost: "https://{YOUR_DOMAIN}.genauth.ai",
  redirectUri: "Business callback address",
});
// Construct OIDC authorization login URL
let url = client.buildAuthorizeUrl();
// If you need to obtain Refresh token, please add offline_access item in scope
let url2 = client.buildAuthorizeUrl({ scope: "openid profile offline_access" });

Sample data:

https://oidc1.genauth.ai/oidc/auth?nonce=5485323897342262&state=7400704296715694&scope=openid+profile+offline_access&client_id=5f17a529f64fb009b794a2ff&response_mode=query&redirect_uri=https%3A%2F%2Fbaidu.com&response_type=code&prompt=consent

For details, please refer to [Document](/reference/sdk-for-node/authentication/StandardProtocol.html#Generate-oidc-protocol user login link).

References:

  1. [scope and user information correspondence table](/concepts/oidc-common-questions.md#scope-parameter corresponding user information)

  2. response_type parameter OIDC specification (opens new window)

  3. prompt parameter OIDC specification (opens new window)

Back to list

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.