Skip to content

Commit

Permalink
Merge pull request #164 from ldclakmal/dev
Browse files Browse the repository at this point in the history
Send optional parameters to introspection endpoint
  • Loading branch information
ldclakmal authored Jan 16, 2021
2 parents f5d61b7 + 453c807 commit 5e403dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http-ballerina/auth_listener_oauth2_handler.bal
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public client class ListenerOAuth2Handler {
#
# + data - The `http:Request` instance or `string` Authorization header
# + expectedScopes - The expected scopes as `string` or `string[]`
# + customParams - Map of custom parameters that need to be sent to introspection endpoint
# + optionalParams - Map of optional parameters that need to be sent to introspection endpoint
# + return - The `oauth2:IntrospectionResponse` instance or else `Unauthorized` or `Forbidden` type in case of an error
remote isolated function authorize(Request|string data, string|string[]? expectedScopes = (),
map<string>? customParams = ())
map<string>? optionalParams = ())
returns oauth2:IntrospectionResponse|Unauthorized|Forbidden {
string credential = extractCredential(data);
oauth2:IntrospectionResponse|oauth2:Error details = self.provider.authorize(credential);
oauth2:IntrospectionResponse|oauth2:Error details = self.provider.authorize(credential, optionalParams);
if (details is oauth2:Error || !details.active) {
Unauthorized unauthorized = {};
return unauthorized;
Expand Down

0 comments on commit 5e403dc

Please # to comment.