Skip to content

Commit

Permalink
Remove passage of private key to auth - it shouldn't be necessary wit…
Browse files Browse the repository at this point in the history
…h PKCE. Revisit if we switch to the JWT method.
  • Loading branch information
danielnaab committed Aug 9, 2024
1 parent 43c274b commit 6b9008b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions apps/server-doj/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ export const createCustomServer = async (): Promise<any> => {
);
const db = createDatabaseGateway(dbCtx);

const secrets = getServerSecrets();
return createServer({
title: 'DOJ Form Service',
db,
loginGovOptions: {
loginGovUrl: 'https://idp.int.identitysandbox.gov',
clientId:
'urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:tts-10x-atj-dev-server-doj',
clientSecret: secrets.loginGovClientSecret,
clientSecret: '', // secrets.loginGovClientSecret,
},
});
};

export const getServerSecrets = () => {
/*
const getServerSecrets = () => {
const services = JSON.parse(process.env.VCAP_SERVICES || '{}');
const loginClientSecret =
services['user-provided']?.credentials?.SECRET_LOGIN_GOV_PRIVATE_KEY;
return {
loginGovClientSecret: loginClientSecret,
};
};
*/
7 changes: 4 additions & 3 deletions apps/server-kansas/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ export const createCustomServer = async (): Promise<any> => {
);
const db = createDatabaseGateway(dbCtx);

const secrets = getServerSecrets();
return createServer({
title: 'KS Courts Form Service',
db,
loginGovOptions: {
loginGovUrl: 'https://idp.int.identitysandbox.gov',
clientId:
'urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:tts-10x-atj-dev-server-doj',
clientSecret: secrets.loginGovClientSecret,
clientSecret: '', // secrets.loginGovClientSecret,
},
});
};

export const getServerSecrets = () => {
/*
const getServerSecrets = () => {
const services = JSON.parse(process.env.VCAP_SERVICES || '{}');
const loginClientSecret =
services['user-provided']?.credentials?.SECRET_LOGIN_GOV_PRIVATE_KEY;
return {
loginGovClientSecret: loginClientSecret,
};
};
*/
2 changes: 1 addition & 1 deletion packages/auth/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class LoginGov implements OAuth2ProviderWithPKCE {
code,
{
authenticateWith: 'request_body',
credentials: this.clientSecret,
//credentials: this.clientSecret,
codeVerifier,
}
);
Expand Down

0 comments on commit 6b9008b

Please sign in to comment.