auth-backend: prettier + changeset tweak
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/plugin-auth-backend': minor
|
||||
---
|
||||
|
||||
Google and OIDC token subs will be full entity ref
|
||||
The `sub` claim in Backstage tokens generated by the default Google and OIDC sign-in resolvers are now full entity references of the format `<kind>:<namespace>/<name>`.
|
||||
|
||||
+1
-1
@@ -84,4 +84,4 @@
|
||||
| [Livspace](https://www.livspace.com) | [Praveen Kumar](https://github.com/praveen-livspace) | Developer portal, service catalog, tech docs, API docs and plugins |
|
||||
| [Just Eat Takeaway](https://www.justeattakeaway.com) | [Kim Wilson](https://github.com/kwilson541) | Our developer portal which centralises applications, reduces cognitive load and provides teams insights. |
|
||||
| [Hopin](https://hopin.com) | [Vladimir Glafirov](https://github.com/vglafirov), [Chloe Lee](https://github.com/msfuko) | Developer portal to streamline the development practices. Integrated with service catalog, software templates, application monitoring, tech docs and plugins. |
|
||||
| [HBO Max](https://hbomax.com) | [@mdb](https://github.com/mdb), [@nesta219](https://github.com/nesta219), [@nmische](https://github.com/nmische), [@hbomark](https://github.com/hbomark) | Developer portal hosting service catalog and API documentation, as well as cloud infrastructure details, operational visibility tools, and a custom plugin for browsing notable platform change events, such as deployments and configuration updates. |
|
||||
| [HBO Max](https://hbomax.com) | [@mdb](https://github.com/mdb), [@nesta219](https://github.com/nesta219), [@nmische](https://github.com/nmische), [@hbomark](https://github.com/hbomark) | Developer portal hosting service catalog and API documentation, as well as cloud infrastructure details, operational visibility tools, and a custom plugin for browsing notable platform change events, such as deployments and configuration updates. |
|
||||
|
||||
@@ -211,22 +211,23 @@ export class OidcAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
export const oAuth2DefaultSignInResolver: SignInResolver<OidcAuthResult> =
|
||||
async (info, ctx) => {
|
||||
const { profile } = info;
|
||||
export const oAuth2DefaultSignInResolver: SignInResolver<
|
||||
OidcAuthResult
|
||||
> = async (info, ctx) => {
|
||||
const { profile } = info;
|
||||
|
||||
if (!profile.email) {
|
||||
throw new Error('Profile contained no email');
|
||||
}
|
||||
const userId = profile.email.split('@')[0];
|
||||
const token = await ctx.tokenIssuer.issueToken({
|
||||
claims: {
|
||||
sub: `user:default/${userId}`,
|
||||
ent: [`user:default/${userId}`],
|
||||
},
|
||||
});
|
||||
return { id: userId, token };
|
||||
};
|
||||
if (!profile.email) {
|
||||
throw new Error('Profile contained no email');
|
||||
}
|
||||
const userId = profile.email.split('@')[0];
|
||||
const token = await ctx.tokenIssuer.issueToken({
|
||||
claims: {
|
||||
sub: `user:default/${userId}`,
|
||||
ent: [`user:default/${userId}`],
|
||||
},
|
||||
});
|
||||
return { id: userId, token };
|
||||
};
|
||||
|
||||
/**
|
||||
* OIDC provider callback options. An auth handler and a sign in resolver
|
||||
|
||||
Reference in New Issue
Block a user