Object -
auth
:
InboundBasicAuthProvider
Represents the configuration file based inbound Basic Auth provider, which is an implementation of the
auth:InboundAuthProvider interface.
auth:InboundBasicAuthProvider inboundBasicAuthProvider = new;
A user is denoted by a section in the Ballerina configuration file. The password and the scopes assigned to the user are denoted as keys under the relevant user section as shown below.
[b7a.users.<username>]
password="<password>"
scopes="<comma_separated_scopes>"
Constructor
__init
(BasicAuthConfig? basicAuthConfig)
- basicAuthConfig BasicAuthConfig? ()
-
Basic Auth provider configurations
Methods
Attempts to authenticate the base64-encoded username:password credentials.
Fields
- basicAuthConfig BasicAuthConfig
-
The Basic Auth provider configurations
Attempts to authenticate the base64-encoded username:password credentials.
boolean|auth:Error authenticationResult = inboundBasicAuthProvider.authenticate("<credential>");
Parameters
- credential string
-
Base64-encoded
username:passwordvalue
-
Return Type
(boolean | Error) trueif the authentication is successful,falseotherwise, or else anauth:Erroroccurred while authenticating the credentials