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

      • Installation and use
      • User authentication module

        • Login

        • Logout

        • Manage Token

        • Register

        • User information

        • Account Binding

        • MFA Factor Management

        • User-related resources

        • Message service

        • Authentication

        • Others

        • OIDC module
        • OAuth module
        • SAML module
        • CAS module
        • Events
      • Management module

    • Node.js

    • Python

  • Error Codes
  1. Development Integration
  2. /
  3. SDK
  4. /
  5. Java
  6. /
  7. User authentication module

  8. /
  9. SAML module

¶ GenAuth - Java SDK SAML module

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

Security Assertion Markup Language (SAML, pronounced sam-el) is an open XML-based standard data format for exchanging authentication and authorization data between parties, especially between identity providers and service providers.

¶ Initialization

When initializing AuthenticationClient, you need to pass the AuthenticationClientOptions parameter, some of its properties are listed below:

  • appId <String> App ID, required.

  • secret <String> Application Key, required.

  • host <String> Full application address, such as https://sample-app.genauth.ai, without the final slash '/'.

  • redirectUri <String> Business callback URL, required. For details, please refer to Authorization Code Mode (opens new window).

  • protocol <ProtocolEnum> Protocol type, optional values ​​are OIDC, OAUTH, SAML, CAS, default is OIDC.

  • tokenEndPointAuthMethod <AuthMethodEnum> Get token endpoint verification method, optional values ​​are CLIENT_SECRET_POST, CLIENT_SECRET_BASIC, NONE, default is CLIENT_SECRET_POST.

  • introspectionEndPointAuthMethod <AuthMethodEnum> Inspection token endpoint authentication method, optional values ​​are CLIENT_SECRET_POST, CLIENT_SECRET_BASIC, NONE, default is CLIENT_SECRET_POST.

  • revocationEndPointAuthMethod <AuthMethodEnum> Revocation token endpoint authentication method, optional values ​​are CLIENT_SECRET_POST, CLIENT_SECRET_BASIC, NONE, default is CLIENT_SECRET_POST.

¶ Example

// Initialize with AppId and appHost
AuthenticationClientOptions options = new AuthenticationClientOptions();
options.setAppId("AUTHING_APP_ID");
options.setAppHost("AUTHING_APP_HOST");
options.setProtocol(ProtocolEnum.SAML.getValue());
AuthenticationClient authenticationClient = null;
try {
  authenticationClient = new AuthenticationClient(options);
} catch (IOException | ParseException e) {
  e.printStackTrace();
}

¶ Generate user login link for SAML2 protocol

authenticationClient.buildAuthorizeUrl()

Generate user login link for SAML2 protocol

¶ Parameters

None

¶ Example

// Splice SAML2 Login link
//options.setProtocol(ProtocolEnum.SAML.getValue());

String respDto = authenticationClient.buildAuthorizeUrl();

¶ Sample Data

https://oidc1.genauth.ai/api/v2/saml-idp/5f17a529f64fb009b794a2ff
Previous article: OAuth module Next article: CAS module
  • Initialization
  • Generate user login link for SAML2 protocol

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.