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

        • 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. CAS Module
Update time: 2025-07-23 07:34:21
Edit

¶ GenAuth - Python SDK CSA module

CAS is the abbreviation of Central Authentication Service, an independent open command protocol.

¶ Initialization

  • app_id <str> Application ID, required.

  • app_host <str> Full application address, such as https://sample-app.genauth.ai, without the last slash '/'.

  • protocol <str> Protocol type, optional values ​​are oidc, oauth, saml, cas, fill in cas here.

¶ Example

from genauth.v2.authentication import AuthenticationClient, AuthenticationClientOptions

authentication_client = AuthenticationClient
options=AuthenticationClientOptions(
app_id='GEN_AUTH_APP_ID',
app_host='https://YOUR_DOMAIN.genauth.ai',
protocol='cas',
))

¶ Generate a user login link for the CAS protocol

def build_authorize_url(self):
pass

Generate a user login link for the CAS protocol.

¶ Parameters

None

¶ Example

from genauth.v2.authentication import AuthenticationClient, AuthenticationClientOptions

authentication_client = AuthenticationClient
options=AuthenticationClientOptions(
app_id='GEN_AUTH_APP_ID',
app_host='https://YOUR_DOMAIN.genauth.ai',
protocol='cas',
))

url = authentication_client.build_authorize_url()

¶ Example data

https://oidc1.genauth.ai/cas-idp/5f17a529f64fb009b794a2ff/login?service=https://example.com

¶ Verify the validity of CAS 1.0 Ticket

def validate_ticket_v1(self, ticket, service):
pass

Verify CAS 1.0 Ticket validity.

¶ Parameters

  • ticket <str> The ticket issued by GenAuth after successful CAS authentication.

  • service <str> CAS callback address.

¶ Example

from genauth.v2.authentication import AuthenticationClient, AuthenticationClientOptions

authentication_client = AuthenticationClient
options=AuthenticationClientOptions(
app_id='GEN_AUTH_APP_ID',
app_host='https://YOUR_DOMAIN.genauth.ai',
protocol='cas',
))

data = authentication_client.validate_ticket_v1(
ticket='ticket content',
service='service address'
)

¶ Example data

When the ticket is valid, it returns:

{
  "valid": true,
  "username": "user1"
}

When the ticket is invalid, it returns:

{
  "valid": false,
  "message": "ticket is invalid"
}

¶ Concatenate the logout URL

def build_logout_url(self, redirect_uri=None):
pass

Concatenate the logout URL.

¶ Parameters

  • redirect_uri <str> The redirection address after logout.

¶ Example

from genauth.v2.authentication import AuthenticationClient, AuthenticationClientOptions

authentication_client = AuthenticationClient
options=AuthenticationClientOptions(
app_id='GEN_AUTH_APP_ID',
app_host='https://YOUR_DOMAIN.genauth.ai',
protocol='cas',
))

data = authentication_client.build_logout_url(
redirect_uri='http://localhost:3000',
)

¶ Sample data

https://oidc1.genauth.ai/cas-idp/5f17a529f64fb009b794a2ff/logout?service=https://example.com
Previous article: SAML Module Next article: Events
  • Initialization
  • Generate a user login link for the CAS protocol
  • Verify the validity of CAS 1.0 Ticket
  • Concatenate the logout URL

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.