break identity client into an interface
The interface has changed a little instead of allowing the client to parse out the authorization header, it takes the request object as is to extract the identity from it how the implementation decides. IdentityClient#authenticate is now deprecated, in favor of IdentityApi#getIdentity. I am leaving the IdentityClient in place deprecated so that plugins that use this can migrate away from it. Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
@@ -46,7 +46,7 @@ The source code is available here:
|
||||
Create a new `packages/backend/src/plugins/todolist.ts` with the following content:
|
||||
|
||||
```javascript
|
||||
import { IdentityClient } from '@backstage/plugin-auth-node';
|
||||
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
|
||||
import { createRouter } from '@internal/plugin-todo-list-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
@@ -57,7 +57,7 @@ The source code is available here:
|
||||
}: PluginEnvironment): Promise<Router> {
|
||||
return await createRouter({
|
||||
logger,
|
||||
identity: IdentityClient.create({
|
||||
identity: DefaultIdentityClient.create({
|
||||
discovery,
|
||||
issuer: await discovery.getExternalBaseUrl('auth'),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user