Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@criipto/oidc

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@criipto/oidc - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

14

dist/index.d.ts
export { generate as generatePKCE } from './pkce';
export { parseQueryResponse, parseURLResponse } from './response';
import { type OpenIDConfiguration } from './OpenIDConfiguration';
import { AuthorizeResponse } from './response';
import { ErrorResponse } from './response';
export { OpenIDConfigurationManager, type OpenIDConfiguration } from './OpenIDConfiguration';

@@ -36,2 +36,12 @@ export declare function buildLogoutURL(configuration: OpenIDConfiguration, options: {

code_verifier: string;
}): Promise<AuthorizeResponse>;
} | {
code: string;
redirect_uri: string;
client_secret: string;
}): Promise<{
id_token: string;
access_token: string;
} | ErrorResponse>;
export declare function userInfo(configuration: OpenIDConfiguration, accessToken: string): Promise<{
[key: string]: string;
} | ErrorResponse>;

@@ -12,3 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.codeExchange = exports.parseAuthorizeOptionsFromUrl = exports.buildAuthorizeURL = exports.buildLogoutURL = exports.OpenIDConfigurationManager = exports.parseURLResponse = exports.parseQueryResponse = exports.generatePKCE = void 0;
exports.userInfo = exports.codeExchange = exports.parseAuthorizeOptionsFromUrl = exports.buildAuthorizeURL = exports.buildLogoutURL = exports.OpenIDConfigurationManager = exports.parseURLResponse = exports.parseQueryResponse = exports.generatePKCE = void 0;
var pkce_1 = require("./pkce");

@@ -70,16 +70,35 @@ Object.defineProperty(exports, "generatePKCE", { enumerable: true, get: function () { return pkce_1.generate; } });

body.append('redirect_uri', options.redirect_uri);
body.append('code_verifier', options.code_verifier);
if ("code_verifier" in options)
body.append('code_verifier', options.code_verifier);
const response = yield fetch(configuration.token_endpoint, {
method: 'POST',
headers: Object.assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, ("client_secret" in options ? {
Authorization: "Basic " + btoa(`${configuration.client_id}:${options.client_secret}`)
} : {})),
credentials: 'omit',
body: body.toString()
});
const payload = yield response.json();
if (payload.error)
return { error: payload.error, error_description: payload.error_description };
return { id_token: payload.id_token, access_token: payload.access_token };
});
}
exports.codeExchange = codeExchange;
function userInfo(configuration, accessToken) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield fetch(configuration.userinfo_endpoint, {
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
Authorization: `Bearer ${accessToken}`
},
credentials: 'omit',
body: body.toString()
});
const payload = yield response.json();
return { id_token: payload.id_token };
if (payload.error)
return { error: payload.error, error_description: payload.error_description, state: payload.state };
return payload;
});
}
exports.codeExchange = codeExchange;
exports.userInfo = userInfo;
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "@criipto/oidc",
"version": "1.1.3",
"version": "1.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc