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
Development Integration
  • API

  • SDK

    • Java

    • Node.js

    • Python

      • Installation and Usage
      • Authentication Module

        • Login

        • Logout

          • Frontend Logout
          • Backend Logout
        • Register

        • User Profile

        • Account Binding

        • MFA Factor Management

        • User Related Resources

        • Message Service

        • WeChat Related APIs

        • Others

        • OIDC Module
        • OAuth Module
        • SAML Module
        • CAS Module
        • Events
      • Management Module

  • Error Codes
  1. Development Integration
  2. /
  3. SDK
  4. /
  5. Python
  6. /
  7. Authentication Module

  8. /
  9. Logout

  10. /
  11. Backend Logout

¶ Backend Logout

Update time: 2025-07-23 07:34:21
Edit

Depending on the different terminals and specific usage scenarios, we provide two logout methods: frontend logout and backend logout:

  • frontend logout: Frontend logout means that the user accesses the logout address on the frontend, and after logging out, the server will clear the user's login status. This logout method generally requires the participation of the browser and needs to be used in the browser environment. The Node SDK provides a method for generating a logout address, and developers can guide users to access this address on the frontend.

  • backend logout: Backend logout refers to calling the method of revoking access_token in the backend service to invalidate the user's access_token and achieve the logout effect. It is suitable for scenarios where the login status is managed using Token.

This part of the document describes the method of generating a backend to withdraw the user's access_token.

¶ Request parameters

NameType
Required
Default value
Description
Sample value
tokenstringYes-User's access_tokenxxxxxx

¶ Sample code

from authing import AuthenticationClient

# Initialize AuthenticationClient
authentication_client = AuthenticationClient(
# GenAuth application ID
app_id='GEN_AUTH_APP_ID',

# GenAuth application secret
app_secret='GEN_AUTH_APP_SECRET',

# GenAuth application address, such as https://example.genauth.ai
app_host='GEN_AUTH_APP_HOST',

# Login callback address configured by GenAuth application
redirect_uri='GEN_AUTH_APP_REDIRECT_URI',
)

success = authentication_client.revoke_token("xxxx")
print(success)

¶ Request response

Type: boolean

Example result:

true
Previous article: Frontend Logout Next article: Register with Username Password
  • Request parameters
  • Sample code
  • Request response

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.