是否有办法在后台编辑AAD登录的范围键?



我有一个后台实例,其中我使用AAD登录,其中后台正在传递一些范围,如"用户。阅读offline_access等;值,我想增加几个键,如"日历。读写"。有没有办法在后台做到这一点。

我试图在范围键中传递。/默认值。我已经搜索了很多可能的解决方案,但没有得到任何一个

如果我没有弄错,您想转换为User实体创建的值吗?

本文档可能会有所帮助,如果适用的话。

以下提供了每种变压器的示例

import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import {
defaultGroupTransformer,
defaultUserTransformer,
defaultOrganizationTransformer,
} from '@backstage/plugin-catalog-backend-module-msgraph';
import { GroupEntity, UserEntity } from '@backstage/catalog-model';
// This group transformer completely replaces the built in logic with custom logic.
export async function myGroupTransformer(
group: MicrosoftGraph.Group,
groupPhoto?: string,
): Promise<GroupEntity | undefined> {
return {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Group',
metadata: {
name: group.id!,
annotations: {},
},
spec: {
type: 'aad',
children: [],
},
};
}
// This user transformer makes use of the built in logic, but also sets the description field
export async function myUserTransformer(
graphUser: MicrosoftGraph.User,
userPhoto?: string,
): Promise<UserEntity | undefined> {
const backstageUser = await defaultUserTransformer(graphUser, userPhoto);
if (backstageUser) {
backstageUser.metadata.description = 'Loaded from Azure Active Directory';
}
return backstageUser;
}
// Example organization transformer that removes the organization group completely
export async function myOrganizationTransformer(
graphOrganization: MicrosoftGraph.Organization,
): Promise<GroupEntity | undefined> {
return undefined;
}

相关内容

  • 没有找到相关文章

最新更新