Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
var jsrsasign = require('jsrsasign');
var rsaKey = jsrsasign.KEYUTIL.generateKeypair("RSA", 1024);
var e = jsrsasign.hextob64u(rsaKey.pubKeyObj.e.toString(16));
var n = jsrsasign.hextob64u(rsaKey.pubKeyObj.n.toString(16));
var path = '/oidc';
var metadataPath = path + '/.well-known/openid-configuration';
var signingKeysPath = path + '/.well-known/jwks';
var authorizationPath = path + '/connect/authorize';
var userInfoPath = path + '/connect/userinfo';
var endSessionPath = path + '/connect/endsession';
var metadata = {
issuer: path,
jwks_uri: signingKeysPath,
authorization_endpoint: authorizationPath,
userinfo_endpoint: userInfoPath,
end_session_endpoint: endSessionPath,
};
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
var jsrsasign = require('jsrsasign');
var rsaKey = jsrsasign.KEYUTIL.generateKeypair("RSA", 1024);
var e = jsrsasign.hextob64u(rsaKey.pubKeyObj.e.toString(16));
var n = jsrsasign.hextob64u(rsaKey.pubKeyObj.n.toString(16));
var path = '/oidc';
var metadataPath = path + '/.well-known/openid-configuration';
var signingKeysPath = path + '/.well-known/jwks';
var authorizationPath = path + '/connect/authorize';
var userInfoPath = path + '/connect/userinfo';
var endSessionPath = path + '/connect/endsession';
var metadata = {
issuer: path,
jwks_uri: signingKeysPath,
authorization_endpoint: authorizationPath,
userinfo_endpoint: userInfoPath,
end_session_endpoint: endSessionPath,
};
function hashAccessToken(access_token) {
var hash = jsrsasign.crypto.Util.hashString(access_token, "sha256")
var left = hash.substr(0, hash.length / 2);
var left_b64u = jsrsasign.hextob64u(left);
return left_b64u;
}
generate_code_verifier(code_challenge: any): string {
const hash = KJUR.crypto.Util.hashString(code_challenge, 'sha256');
const testdata = hextob64u(hash);
return testdata;
}
}
private generate_at_hash(access_token: any): string {
const hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
const first128bits = hash.substr(0, hash.length / 2);
const testdata = hextob64u(first128bits);
return testdata;
}
}
private generate_at_hash(access_token: any): string {
const hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
const first128bits = hash.substr(0, hash.length / 2);
const testdata = hextob64u(first128bits);
return testdata;
}
OidcSecurityValidation.prototype.generate_at_hash = function (access_token) {
var hash = KJUR.crypto.Util.hashString(access_token, 'sha256');
var first128bits = hash.substr(0, hash.length / 2);
var testdata = hextob64u(first128bits);
return testdata;
};
OidcSecurityValidation.prototype.generate_code_verifier = function (code_challenge) {