diff --git a/cli/manifests.ts b/cli/manifests.ts index 4024118..ec11879 100644 --- a/cli/manifests.ts +++ b/cli/manifests.ts @@ -31,12 +31,7 @@ export const ACTION_MANIFEST: ActionDefinition[] = [ trigger: 'post-login', triggerVersion: 'v3', getData: async () => { - const defaultRoleNames = [ - 'User-Basic-Role', - 'Parfit User', - 'EA Funds User', - 'Giving What We Can User', - ] + const defaultRoleNames = ['User-Basic-Role', 'EA Funds User'] const Roles = await getAllRoles() const defaultRoles = Roles.filter(isValidRole) .filter((Role) => defaultRoleNames.includes(Role.name)) @@ -54,13 +49,7 @@ export const ACTION_MANIFEST: ActionDefinition[] = [ // Get token namespace const namespace = process.env.TOKEN_NAMESPACE - const allowAllScopesApplicationNames = [ - 'EA Funds', - 'Giving What We Can', - 'Parfit Admin', - ] - - const scopesToIdTokenApplicationNames = ['Giving What We Can'] + const allowAllScopesApplicationNames = ['EA Funds'] const Clients = await getAllClients() const validClients = Clients.filter(isValidClient) @@ -75,20 +64,8 @@ export const ACTION_MANIFEST: ActionDefinition[] = [ }) ) - const addScopesToIdTokenApplications = Clients.filter(isValidClient) - .filter((Client) => - scopesToIdTokenApplicationNames.includes(Client.name) - ) - .map((Client) => - getCommentValue({ - applicationName: Client.name, - value: Client.client_id, - }) - ) - return { allowAllScopesWhitelist, - addScopesToIdTokenApplications, namespace, } }, diff --git a/scripts/actions/src/manage-scopes.ts b/scripts/actions/src/manage-scopes.ts index d48313a..43468d5 100644 --- a/scripts/actions/src/manage-scopes.ts +++ b/scripts/actions/src/manage-scopes.ts @@ -119,13 +119,4 @@ exports.onExecutePostLogin = async ( for (const scope of removedScopes) { api.accessToken.removeScope(scope) } - - // Add scopes to id token - const finalScopes = requestedScopes.filter((s) => allowedScopes.includes(s)) - const requiredApplications = TEMPLATE_DATA.addScopesToIdTokenApplications - - if (requiredApplications.includes(clientId)) { - const namespace: string = TEMPLATE_DATA.namespace - api.idToken.setCustomClaim(`${namespace}/scope`, finalScopes.join(' ')) - } }