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. Events

¶ Subscribe to events

¶ Method Name

  • authenticationClient.subEvent(eventCode,receiver)

¶ Request Parameters

  • eventCode <String> event code

  • receiver <Receiver> custom receiver

¶ Sample Code

AuthenticationClientOptions authenOptions = new AuthenticationClientOptions();
authenOptions.setAppId(APP_ID); // GenAuth App ID
authenOptions.setAppSecret(APP_SECRET); // GenAuth Application Key

AuthenticationClient authenticationClient = new AuthenticationClient(authenOptions);
authenticationClient.subEvent("yourapp.event.code", new Receiver() {
    @Override
    public void onReceiverMessage(String msg) {
        System.out.println(msg);
    }
});

¶ Publish event

  • authenticationClient.pubtEvent(eventCode, data)

¶ Request Parameters

  • eventCode <String> event code
  • data <Object> event body

¶ Sample Code

AuthenticationClientOptions authenOptions = new AuthenticationClientOptions();
authenOptions.setAppId(APP_ID); // GenAuth App ID
authenOptions.setAppSecret(APP_SECRET); // GenAuth Application Key

AuthenticationClient authenticationClient = new AuthenticationClient(authenOptions);
String eventData = "{\"id\":\"myid\",\"createdAt\":1675579686427,\"updatedAt\":1675579686427}";
CommonResponseDto result = authenticationClient.pubtEvent("yourapp.event.code", eventData);
System.out.println(result);
Previous article: CAS module Next article: Get user list
  • Subscribe to events
  • Publish event

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.