core: removed deprecated IdentityApi methods

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-04 21:56:26 +01:00
parent 9c5cd63243
commit ceebe25391
12 changed files with 117 additions and 83 deletions
+24
View File
@@ -0,0 +1,24 @@
---
'@backstage/core-plugin-api': minor
---
Removed deprecated `IdentityApi` methods: `getUserId`, `getIdToken`, and `getProfile`.
Existing usage of `getUserId` can be replaced by `getBackstageIdentity`, more precisely the equivalent of the previous `userId` can be retrieved like this:
```ts
import { parseEntityRef } from '@backstage/catalog-model';
const identity = await identityApi.getBackstageIdentity();
const { name: userId } = parseEntityRef(identity.userEntityRef);
```
Note that it is recommended to consume the entire `userEntityRef` rather than parsing out just the name, in order to support namespaces.
Existing usage of `getIdToken` can be replaced by `getCredentials`, like this:
```ts
const { token } = await identityApi.getCredentials();
```
And existing usage of `getProfile` is replaced by `getProfileInfo`, which returns the same profile object, but is now async.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/core-app-api': minor
'@backstage/core-plugin-api': minor
---
Removed deprecated `SignInResult` type, which was replaced with the new `onSignInSuccess` callback.