GenAuth DocsDocuments
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
Concepts
  • What is GenAuth
  • What is User Pool
  • What is Application
  • What is Authentication
  • What is Federation Authentication
  • What is Zero Trust Network
  • Single Sign-On and Single Sign-Out
  • What is Authorization
  • Authentication vs Authorization
  • What is JWT Token
  • What is ID Token
  • What is Access Token
  • What is Refresh Token
  • Access Token vs Id Token
  • Understanding OIDC and OAuth2.0 Protocol

    • OIDC and OAuth2.0 Overview
    • Choose OIDC Authorization Mode
    • OIDC Common Questions
  • Understanding SAML2 Protocol

  • What is Multi-Factor Authentication
  • Account Lifecycle Management
  • Hosted Login Page vs Embeddable Login Component
  • CIAM and EIAM
  • What is LDAP
  • How QR Code Login Works
  • Basic Concepts of Cryptography
  1. Concepts
  2. /
  3. Understanding OIDC and OAuth2.0 Protocol

  4. /
  5. Choose OIDC Authorization Mode

¶ Choose OIDC authorization mode

Update time: 2025-04-11 11:21:15
Edit

You need to choose a suitable authentication and authorization mode according to your scenario and the type of application you develop. This article will help you choose the appropriate OIDC authorization mode.

¶ Recommended authorization mode

Different types of applications require different authorization modes. The following table shows the modes we recommend:

Application typeAuthorization mode
With backend scenarioAuthorization code mode
SPA, no backendImplicit mode
Between serversClient Credentials

¶ Does your application need an ID Token?

Authorization ModeAccess TokenId Token
Authorization Code Mode✅✅
Implicit Mode✅✅
Password Mode✅✅
Client Credentials Mode✅❌

¶ What type of application is yours?

How to choose the OIDC authorization mode depends on what type of application you are developing. Refer to the following flow chart to choose the authorization mode you need:

¶ Is your application code publicly accessible?

If your end users can see and modify your application code, then the application is publicly accessible. This includes SPA (single page web application) and mobile applications. In this scenario, the application cannot store keys securely.

¶ Is your application a SPA or a native application?

If your application is a single-page web application, running in a new version of the browser, and the browser supports Web Crypto, you should use PKCE + authorization code mode. If your application runs in an old version of the browser, the browser does not support Web Crypto, you should use implicit mode. Implicit mode is only suitable for scenarios where the application cannot store keys securely. You should only consider using implicit mode if other modes are not available.

If your application is a native application, you should use PKCE + authorization code mode.

¶ Are there any end users using your application?

If your application runs on the server side, is not directly used by end users, and is only interacting between servers, you should use Client Credentials mode.

¶ Are the application and resources owned by the same party?

If your application and the resources that the application needs to access are all controlled by you, and your application can securely store user accounts and passwords, the code logic is secure enough. When other authorization modes are not suitable, you can choose password mode.

¶ Authorization code mode

The authorization code mode is suitable for scenarios where the application has a backend server. The authorization code mode requires that the application must be able to securely store keys for subsequent use of authorization codes to exchange for Access Tokens. The authorization code mode requires the browser to interact with the end user to complete the authentication and authorization, and then send the authorization code to the backend service through browser redirection, and then exchange the authorization code for token and token for user information.

For more information, please refer to Using the Authorization Code Mode.

¶ Implicit Mode

The implicit mode is suitable for scenarios where keys cannot be stored securely (such as front-end browsers). In implicit mode, the application does not need to use code to exchange tokens, and does not need to request the /token endpoint. AccessToken and IdToken will be returned directly from the authentication endpoint.

Because the implicit mode is used in scenarios where keys cannot be stored securely, the implicit mode does not support obtaining Refresh Token.

For more information, please refer to Using Implicit Mode.

¶ Password Mode

Password mode is suitable for scenarios where you control both the application and the resources required by the application. Password mode requires the application to store keys securely and to be trusted to store the account and password of the resource owner. It is generally common in self-owned applications using their own resources. Password mode does not require redirection jumps, only the user account and password need to be carried to access the Token endpoint.

For more information, please refer to Using Password Mode.

¶ Client Credentials Mode

Client Credentials mode is used for server-to-server authorization (M2M authorization) without user participation. You need to create a programmatic access account and give the AK and SK key pairs to your resource caller.

Client Credentials mode does not support Refresh Token.

For more information, refer to Using Client Credentials Mode.

Previous article: OIDC and OAuth2.0 Overview Next article: OIDC Common Questions
  • Recommended authorization mode
  • Does your application need an ID Token?
  • What type of application is yours?
  • Is your application code publicly accessible?
  • Is your application a SPA or a native application?
  • Are there any end users using your application?
  • Are the application and resources owned by the same party?
  • Authorization code mode
  • Implicit Mode
  • Password Mode
  • Client Credentials Mode

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.