Skip to content

Commit

Permalink
Merge pull request #192 from ruks/master
Browse files Browse the repository at this point in the history
Add null check
  • Loading branch information
ruks authored Jul 6, 2018
2 parents 5467709 + 0bd3b72 commit cde41f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ public type AuthnFilter object {
authenticationContext.stopOnQuotaReach = <boolean>apiKeyValidationDto.stopOnQuotaReach;
authenticationContext.isContentAwareTierPresent = <boolean> apiKeyValidationDto
.contentAware;
authenticationContext.callerToken = apiKeyValidationDto.endUserToken;
if(authenticationContext.callerToken != "") {
printDebug(KEY_AUTHN_FILTER, "Caller token: " + authenticationContext.callerToken);
if(authenticationContext.callerToken != "" && authenticationContext.callerToken != null) {
string jwtheaderName = getConfigValue(JWT_CONFIG_INSTANCE_ID, JWT_HEADER,
JWT_HEADER_NAME);
request.setHeader(jwtheaderName, authenticationContext.callerToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public type SubscriptionFilter object {
authenticationContext.tier = subscription.subscriptionTier.toString();
authenticationContext.apiKey = jwtToken;
authenticationContext.username = decodedPayload.sub.toString();
authenticationContext.callerToken = jwtToken ;
authenticationContext.callerToken = jwtToken;
authenticationContext.applicationId = decodedPayload.application.id.toString();
authenticationContext.applicationName = decodedPayload.application.name.toString();
authenticationContext.applicationTier = decodedPayload.application.tier.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function OAuthAuthProvider::invokeKeyValidation(APIRequestMetaDataDto api
string accessToken = apiRequestMetaDataDto.accessToken;
boolean authorized = false;
json keyValidationInfoJson = self.doKeyValidation(apiRequestMetaDataDto);
printTrace(KEY_OAUTH_PROVIDER, "key Validation json " + keyValidationInfoJson.toString());
match <string>keyValidationInfoJson.authorized {
string authorizeValue => {
boolean auth = <boolean>authorizeValue;
Expand Down

0 comments on commit cde41f6

Please sign in to comment.