angular-oauth2-oidc
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"metadata":{"OAuthModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[],"exports":[]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"OAuthModule"},"providers":[{"__symbolic":"reference","name":"OAuthService"},{"__symbolic":"reference","name":"ɵa"}]}}}},"OAuthService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"ɵa"}]}],"getKeyCount":[{"__symbolic":"method"}],"debug":[{"__symbolic":"method"}],"validateUrlFromDiscoveryDocument":[{"__symbolic":"method"}],"validateUrlForHttps":[{"__symbolic":"method"}],"validateUrlAgainstIssuer":[{"__symbolic":"method"}],"setupTimer":[{"__symbolic":"method"}],"setupAccessTokenTimer":[{"__symbolic":"method"}],"setupIdTokenTimer":[{"__symbolic":"method"}],"clearAccessTokenTimer":[{"__symbolic":"method"}],"clearIdTokenTimer":[{"__symbolic":"method"}],"calcTimeout":[{"__symbolic":"method"}],"setStorage":[{"__symbolic":"method"}],"loadDiscoveryDocument":[{"__symbolic":"method"}],"validateDiscoveryDocument":[{"__symbolic":"method"}],"fetchTokenUsingPasswordFlowAndLoadUserProfile":[{"__symbolic":"method"}],"loadUserProfile":[{"__symbolic":"method"}],"fetchTokenUsingPasswordFlow":[{"__symbolic":"method"}],"refreshToken":[{"__symbolic":"method"}],"removeSilentRefreshEventListener":[{"__symbolic":"method"}],"setupSilentRefreshEventListener":[{"__symbolic":"method"}],"silentRefresh":[{"__symbolic":"method"}],"createLoginUrl":[{"__symbolic":"method"}],"initImplicitFlow":[{"__symbolic":"method"}],"callOnTokenReceivedIfExists":[{"__symbolic":"method"}],"storeAccessTokenResponse":[{"__symbolic":"method"}],"tryLogin":[{"__symbolic":"method"}],"validateNonceForAccessToken":[{"__symbolic":"method"}],"storeIdToken":[{"__symbolic":"method"}],"handleLoginError":[{"__symbolic":"method"}],"processIdToken":[{"__symbolic":"method"}],"getIdentityClaims":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"padBase64":[{"__symbolic":"method"}],"getAccessToken":[{"__symbolic":"method"}],"getAccessTokenExpiration":[{"__symbolic":"method"}],"getIdTokenExpiration":[{"__symbolic":"method"}],"hasValidAccessToken":[{"__symbolic":"method"}],"hasValidIdToken":[{"__symbolic":"method"}],"authorizationHeader":[{"__symbolic":"method"}],"logOut":[{"__symbolic":"method"}],"createAndSaveNonce":[{"__symbolic":"method"}],"createNonce":[{"__symbolic":"method"}],"checkAtHash":[{"__symbolic":"method"}],"checkSignature":[{"__symbolic":"method"}]}},"JwksValidationHandler":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractValidationHandler"},"members":{"validateSignature":[{"__symbolic":"method"}],"calcHash":[{"__symbolic":"method"}],"toByteArrayAsString":[{"__symbolic":"method"}]}},"NullValidationHandler":{"__symbolic":"class","members":{"validateSignature":[{"__symbolic":"method"}],"validateAtHash":[{"__symbolic":"method"}]}},"ValidationParams":{"__symbolic":"interface"},"ValidationHandler":{"__symbolic":"interface"},"AbstractValidationHandler":{"__symbolic":"class","members":{"validateSignature":[{"__symbolic":"method"}],"validateAtHash":[{"__symbolic":"method"}],"inferHashAlgorithm":[{"__symbolic":"method"}],"calcHash":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"getHashFragmentParams":[{"__symbolic":"method"}],"parseQueryString":[{"__symbolic":"method"}]}}},"origins":{"OAuthModule":"./index","OAuthService":"./oauth-service","JwksValidationHandler":"./token-validation/jwks-validation-handler","NullValidationHandler":"./token-validation/null-validation-handler","ValidationParams":"./token-validation/validation-handler","ValidationHandler":"./token-validation/validation-handler","AbstractValidationHandler":"./token-validation/validation-handler","ɵa":"./url-helper.service"},"importAs":"angular-oauth2-oidc"} | ||
{"__symbolic":"module","version":3,"metadata":{"OAuthModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[],"exports":[]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"OAuthModule"},"providers":[{"__symbolic":"reference","name":"OAuthService"},{"__symbolic":"reference","name":"ɵa"}]}}}},"OAuthService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Http"},{"__symbolic":"reference","name":"ɵa"}]}],"getKeyCount":[{"__symbolic":"method"}],"debug":[{"__symbolic":"method"}],"validateUrlFromDiscoveryDocument":[{"__symbolic":"method"}],"validateUrlForHttps":[{"__symbolic":"method"}],"validateUrlAgainstIssuer":[{"__symbolic":"method"}],"setupTimer":[{"__symbolic":"method"}],"setupAccessTokenTimer":[{"__symbolic":"method"}],"setupIdTokenTimer":[{"__symbolic":"method"}],"clearAccessTokenTimer":[{"__symbolic":"method"}],"clearIdTokenTimer":[{"__symbolic":"method"}],"calcTimeout":[{"__symbolic":"method"}],"setStorage":[{"__symbolic":"method"}],"loadDiscoveryDocument":[{"__symbolic":"method"}],"validateDiscoveryDocument":[{"__symbolic":"method"}],"fetchTokenUsingPasswordFlowAndLoadUserProfile":[{"__symbolic":"method"}],"loadUserProfile":[{"__symbolic":"method"}],"fetchTokenUsingPasswordFlow":[{"__symbolic":"method"}],"refreshToken":[{"__symbolic":"method"}],"removeSilentRefreshEventListener":[{"__symbolic":"method"}],"setupSilentRefreshEventListener":[{"__symbolic":"method"}],"silentRefresh":[{"__symbolic":"method"}],"createLoginUrl":[{"__symbolic":"method"}],"initImplicitFlow":[{"__symbolic":"method"}],"callOnTokenReceivedIfExists":[{"__symbolic":"method"}],"storeAccessTokenResponse":[{"__symbolic":"method"}],"tryLogin":[{"__symbolic":"method"}],"validateNonceForAccessToken":[{"__symbolic":"method"}],"storeIdToken":[{"__symbolic":"method"}],"handleLoginError":[{"__symbolic":"method"}],"processIdToken":[{"__symbolic":"method"}],"getIdentityClaims":[{"__symbolic":"method"}],"getIdToken":[{"__symbolic":"method"}],"padBase64":[{"__symbolic":"method"}],"getAccessToken":[{"__symbolic":"method"}],"getAccessTokenExpiration":[{"__symbolic":"method"}],"getIdTokenExpiration":[{"__symbolic":"method"}],"hasValidAccessToken":[{"__symbolic":"method"}],"hasValidIdToken":[{"__symbolic":"method"}],"authorizationHeader":[{"__symbolic":"method"}],"logOut":[{"__symbolic":"method"}],"createAndSaveNonce":[{"__symbolic":"method"}],"createNonce":[{"__symbolic":"method"}],"checkAtHash":[{"__symbolic":"method"}],"checkSignature":[{"__symbolic":"method"}]}},"JwksValidationHandler":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"AbstractValidationHandler"},"members":{"validateSignature":[{"__symbolic":"method"}],"alg2kty":[{"__symbolic":"method"}],"calcHash":[{"__symbolic":"method"}],"toByteArrayAsString":[{"__symbolic":"method"}]}},"NullValidationHandler":{"__symbolic":"class","members":{"validateSignature":[{"__symbolic":"method"}],"validateAtHash":[{"__symbolic":"method"}]}},"ValidationParams":{"__symbolic":"interface"},"ValidationHandler":{"__symbolic":"interface"},"AbstractValidationHandler":{"__symbolic":"class","members":{"validateSignature":[{"__symbolic":"method"}],"validateAtHash":[{"__symbolic":"method"}],"inferHashAlgorithm":[{"__symbolic":"method"}],"calcHash":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"getHashFragmentParams":[{"__symbolic":"method"}],"parseQueryString":[{"__symbolic":"method"}]}}},"origins":{"OAuthModule":"./index","OAuthService":"./oauth-service","JwksValidationHandler":"./token-validation/jwks-validation-handler","NullValidationHandler":"./token-validation/null-validation-handler","ValidationParams":"./token-validation/validation-handler","ValidationHandler":"./token-validation/validation-handler","AbstractValidationHandler":"./token-validation/validation-handler","ɵa":"./url-helper.service"},"importAs":"angular-oauth2-oidc"} |
@@ -991,7 +991,9 @@ (function (global, factory) { | ||
} | ||
/* | ||
if (this.getKeyCount() > 1 && !header.kid) { | ||
var /** @type {?} */ err = 'There needs to be a kid property in the id_token header when multiple keys are defined via the property jwks'; | ||
let err = 'There needs to be a kid property in the id_token header when multiple keys are defined via the property jwks'; | ||
console.warn(err); | ||
return Promise.reject(err); | ||
} | ||
*/ | ||
if (!claims.sub) { | ||
@@ -1370,12 +1372,20 @@ var /** @type {?} */ err = "No sub claim in id_token"; | ||
var /** @type {?} */ key; | ||
if (!kid && params.jwks['keys'].length > 1) { | ||
var /** @type {?} */ error = 'Multiple keys but no kid in token!'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
var /** @type {?} */ alg = params.idTokenHeader['alg']; | ||
if (kid) { | ||
key = keys.find(function (k) { return k['kid'] == kid && k['use'] == 'sig'; }); | ||
} | ||
else if (!kid) { | ||
key = params.jwks['keys'][0]; | ||
} | ||
else { | ||
key = keys.find(function (k) { return k['kid'] == kid && k['use'] == 'sig'; }); | ||
var /** @type {?} */ kty_1 = this.alg2kty(alg); | ||
var /** @type {?} */ matchingKeys = keys.filter(function (k) { return k['kty'] == kty_1 && k['use'] == 'sig'; }); | ||
if (matchingKeys.length == 0) { | ||
var /** @type {?} */ error = 'No matching key found.'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
} | ||
else if (matchingKeys.length > 1) { | ||
var /** @type {?} */ error = 'More than one matching key found. Please specify a kid in the id_token header.'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
} | ||
key = matchingKeys[0]; | ||
} | ||
@@ -1400,2 +1410,13 @@ if (!key) { | ||
/** | ||
* @param {?} alg | ||
* @return {?} | ||
*/ | ||
JwksValidationHandler.prototype.alg2kty = function (alg) { | ||
switch (alg.charAt(0)) { | ||
case 'R': return 'RSA'; | ||
case 'E': return 'EC'; | ||
default: throw new Error('Cannot infer kty from alg: ' + alg); | ||
} | ||
}; | ||
/** | ||
* @param {?} valueToHash | ||
@@ -1402,0 +1423,0 @@ * @param {?} algorithm |
39
index.js
@@ -1000,7 +1000,9 @@ import { Injectable, NgModule } from '@angular/core'; | ||
} | ||
/* | ||
if (this.getKeyCount() > 1 && !header.kid) { | ||
var /** @type {?} */ err = 'There needs to be a kid property in the id_token header when multiple keys are defined via the property jwks'; | ||
let err = 'There needs to be a kid property in the id_token header when multiple keys are defined via the property jwks'; | ||
console.warn(err); | ||
return Promise.reject(err); | ||
} | ||
*/ | ||
if (!claims.sub) { | ||
@@ -1379,12 +1381,20 @@ var /** @type {?} */ err = "No sub claim in id_token"; | ||
var /** @type {?} */ key; | ||
if (!kid && params.jwks['keys'].length > 1) { | ||
var /** @type {?} */ error = 'Multiple keys but no kid in token!'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
var /** @type {?} */ alg = params.idTokenHeader['alg']; | ||
if (kid) { | ||
key = keys.find(function (k) { return k['kid'] == kid && k['use'] == 'sig'; }); | ||
} | ||
else if (!kid) { | ||
key = params.jwks['keys'][0]; | ||
} | ||
else { | ||
key = keys.find(function (k) { return k['kid'] == kid && k['use'] == 'sig'; }); | ||
var /** @type {?} */ kty_1 = this.alg2kty(alg); | ||
var /** @type {?} */ matchingKeys = keys.filter(function (k) { return k['kty'] == kty_1 && k['use'] == 'sig'; }); | ||
if (matchingKeys.length == 0) { | ||
var /** @type {?} */ error = 'No matching key found.'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
} | ||
else if (matchingKeys.length > 1) { | ||
var /** @type {?} */ error = 'More than one matching key found. Please specify a kid in the id_token header.'; | ||
console.error(error); | ||
return Promise.reject(error); | ||
} | ||
key = matchingKeys[0]; | ||
} | ||
@@ -1409,2 +1419,13 @@ if (!key) { | ||
/** | ||
* @param {?} alg | ||
* @return {?} | ||
*/ | ||
JwksValidationHandler.prototype.alg2kty = function (alg) { | ||
switch (alg.charAt(0)) { | ||
case 'R': return 'RSA'; | ||
case 'E': return 'EC'; | ||
default: throw new Error('Cannot infer kty from alg: ' + alg); | ||
} | ||
}; | ||
/** | ||
* @param {?} valueToHash | ||
@@ -1411,0 +1432,0 @@ * @param {?} algorithm |
{ | ||
"name": "angular-oauth2-oidc", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -19,4 +19,5 @@ import { AbstractValidationHandler, ValidationParams } from "./validation-handler"; | ||
validateSignature(params: ValidationParams): Promise<any>; | ||
private alg2kty(alg); | ||
calcHash(valueToHash: string, algorithm: string): string; | ||
toByteArrayAsString(hexString: string): string; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158097
3442