This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Object - auth : InboundAuthProvider

Represents the inbound Auth provider, which could be used to authenticate endpoints. The auth:InboundAuthProvider acts as the interface for all the inbound authentication providers. Any type of implementation such as JWT, OAuth2, LDAP, JDBC, file-based etc. should be object-wise similar.

Methods

Authenticates the user based on the user credentials (i.

authenticate

(string credential)

returns boolean | Error

Authenticates the user based on the user credentials (i.e., the username/password) or a token such as JWT or OAuth2.

Parameters

  • credential string
  • The string credential value

  • Return Type

    (boolean | Error)
  • true if the authentication is successful, false otherwise, or else an auth:Error in case of an error