MCPcopy Create free account
hub / github.com/parse-community/parse-server / getGoogleKeyByKeyId

Function getGoogleKeyByKeyId

src/Adapters/Auth/google.js:56–74  ·  view source on GitHub ↗
(keyId, cacheMaxEntries, cacheMaxAge)

Source from the content-addressed store, hash-verified

54const HTTPS_TOKEN_ISSUER = 'https://accounts.google.com';
55
56const getGoogleKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => {
57 const client = jwksClient({
58 jwksUri: 'https://www.googleapis.com/oauth2/v3/certs',
59 cache: true,
60 cacheMaxEntries,
61 cacheMaxAge,
62 });
63
64 let key;
65 try {
66 key = await authUtils.getSigningKey(client, keyId);
67 } catch {
68 throw new Parse.Error(
69 Parse.Error.OBJECT_NOT_FOUND,
70 `Unable to find matching key for Key ID: ${keyId}`
71 );
72 }
73 return key;
74};
75
76async function verifyIdToken({ id_token: token, id }, { clientId, cacheMaxEntries, cacheMaxAge }) {
77 if (!clientId) {

Callers 1

verifyIdTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…