ballerina.auth.utils package
public function createCache ( string cacheName ) ( Cache )
Creates a cache to store authentication results against basic auth headers
Parameter Name | Data Type | Description |
---|---|---|
cacheName | string |
Return Variable | Data Type | Description |
---|---|---|
Cache | cache: authentication cache instance |
public function extractBasicAuthCredentials ( string authHeader ) ( string , string , error )
Extracts the basic authentication credentials from the header value
Parameter Name | Data Type | Description |
---|---|---|
authHeader | string | basic authentication header |
Return Variable | Data Type | Description |
---|---|---|
string | string: username extracted | |
string | string: password extracted | |
error | error: any error occurred while extracting creadentials |
public function extractBasicAuthHeaderValue ( InRequest req ) ( string , error )
Extracts the basic authentication header value from the request
Parameter Name | Data Type | Description |
---|---|---|
req | InRequest | Inrequest instance |
Return Variable | Data Type | Description |
---|---|---|
string | string: value of the basic authentication header | |
error | error: any error occurred while extracting the basic authentication header |