ballerina/auth package

Primitives Summary

Type Description

Type Definitions

Type Values Description

Annotations

Name Attachement Points Data Type Description

Objects Summary

Object Description
JWTAuthProviderConfig
Represents JWT validator configurations

Endpoints Summary

Endpoint Description

Functions Summary

Return Type Function and Description

Global Variables

Name Data Type Description

public object JWTAuthProviderConfig

Represents JWT validator configurations

Field Name Data Type Default Value Description
issuer string
audience string
clockSkew int
certificateAlias string
trustStoreFilePath string
trustStorePassword string

public type AuthProvider object

Represents the auth provider. Any type of implementation, such as ldap, jdbc, file based, etc. should be
object-wise similar

  • <AuthProvider> authenticate(string username, string password) returns (boolean)

    Parameter Name Data Type Default Value Description
    username string

    user name

    password string

    password

    Return Type Description
    boolean

    true if authentication is a success, else false

  • <AuthProvider> getScopes(string username) returns (string[])

        Reads the scope(s) for the user with the given username
    

    Parameter Name Data Type Default Value Description
    username string

    user name

    Return Type Description
    string[]

    array of groups for the user denoted by the username

public type ConfigAuthProvider object

Represents the ballerina.conf based auth provider

  • <ConfigAuthProvider> authenticate(string user, string password) returns (boolean)

        Attempts to authenticate with username and password
    

    Parameter Name Data Type Default Value Description
    user string

    user name

    password string

    password

    Return Type Description
    boolean

    true if authentication is a success, else false

  • <ConfigAuthProvider> getScopes(string username) returns (string[])

        Reads the scope(s) for the user with the given username
    

    Parameter Name Data Type Default Value Description
    username string

    username

    Return Type Description
    string[]

    array of groups for the user denoted by the username

public type JWTAuthProvider object

Represents a JWT Authenticator

Field Name Data Type Default Value Description
jwtAuthProviderConfig JWTAuthProviderConfig
  • <JWTAuthProvider> authenticate(string jwtToken) returns (boolean | error)

        Authenticate with a jwt token
    

    Parameter Name Data Type Default Value Description
    jwtToken string

    Jwt token extracted from the authentication header

    Return Type Description
    boolean | error

    true if authentication is a success, else false