@egain/ai-agent-sdk API Reference - v0.1.1 / AuthStrategy
Interface: AuthStrategy
Base interface for authentication strategies All authentication strategies must implement this interface
Hierarchy
↳
AuthStrategy
Implemented by
AnonymousAuthStrategyAuthenticationServiceClientCredentialsAuthStrategyPKCEAuthStrategyPreAuthStrategy
Table of contents
Methods
Methods
getToken
▸ getToken(): Promise<null | string>
Get an authentication token This method may be called multiple times, so implementations should handle token refresh if needed
Returns
Promise<null | string>
Inherited from
Defined in
initialize
▸ initialize(options?): Promise<void>
Initialize the authentication strategy This method sets up the strategy but does not perform authentication Called when the strategy is set on the agent
Parameters
| Name | Type | Description |
|---|---|---|
options? | AuthStrategyInitializeOptions | Initialize options including postAuthentication callback |
Returns
Promise<void>
Defined in
authenticate
▸ authenticate(): Promise<void>
Authenticate the user This method performs the actual authentication flow The postAuthentication callback registered during initialize() will be called after authentication completes
Returns
Promise<void>
Defined in
cleanup
▸ cleanup(): Promise<void>
Cleanup resources when the strategy is no longer needed
Returns
Promise<void>
Defined in
getDomain
▸ getDomain(): string
Get the domain for authentication
Returns
string