列出 b2cIdentityUserFlows
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
检索 b2cIdentityUserFlow 对象 的列表。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
IdentityUserFlow.Read.All、IdentityUserFlow.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
IdentityUserFlow.Read.All、IdentityUserFlow.ReadWrite.All
工作或学校帐户需要属于以下角色之一:
HTTP 请求
GET /identity/b2cUserFlows
可选的查询参数
可以使用 展开 $expand 默认不展开的特定用户流属性。
有关详细信息,请参阅 OData 查询参数 。
名称
说明
Authorization
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回 响应代码和 200 OK b2cIdentityUserFlow 对象集合。
示例
示例 1:列出所有 b2cIdentityUserFlow 对象
请求
下面展示了示例请求。
GET https://graph.microsoft.com/beta/identity/b2cUserFlows
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var b2cUserFlows = await graphClient.Identity.B2cUserFlows
.Request()
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let b2cUserFlows = await client.api('/identity/b2cUserFlows')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identity/b2cUserFlows"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphB2cIdentityUserFlow *b2cIdentityUserFlow = [[MSGraphB2cIdentityUserFlow alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
B2cIdentityUserFlowCollectionPage b2cUserFlows = graphClient.identity().b2cUserFlows()
.buildRequest()
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
result, err := graphClient.Identity().B2cUserFlows().Get()
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/b2cUserFlows",
"value": [
{
"id": "B2C_1_CustomerSignUp",
"userFlowType": "signUp",
"userFlowTypeVersion": 1,
"isLanguageCustomizationEnabled": false,
"defaultLanguageTag": null
},
{
"id": "B2C_1_CustomerSignIn",
"userFlowType": "signIn",
"userFlowTypeVersion": 1,
"isLanguageCustomizationEnabled": true,
"defaultLanguageTag": "en"
},
]
}
示例 2:列出所有 b2cIdentityUserFlow 对象并展开 identityProviders
请求
下面展示了示例请求。
GET https://graph.microsoft.com/beta/identity/b2cUserFlows?$expand=identityProviders
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var b2cUserFlows = await graphClient.Identity.B2cUserFlows
.Request()
.Expand("identityProviders")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let b2cUserFlows = await client.api('/identity/b2cUserFlows')
.version('beta')
.expand('identityProviders')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/identity/b2cUserFlows?$expand=identityProviders"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphB2cIdentityUserFlow *b2cIdentityUserFlow = [[MSGraphB2cIdentityUserFlow alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
B2cIdentityUserFlowCollectionPage b2cUserFlows = graphClient.identity().b2cUserFlows()
.buildRequest()
.expand("identityProviders")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.B2cUserFlowsRequestBuilderGetQueryParameters{
Expand: "identityProviders",
}
options := &msgraphsdk.B2cUserFlowsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.Identity().B2cUserFlows().GetWithRequestConfigurationAndResponseHandler(options, nil)
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/b2cUserFlows",
"value": [
{
"id": "B2C_1_CustomerSignUp",
"userFlowType": "signUp",
"userFlowTypeVersion": 1,
"isLanguageCustomizationEnabled": false,
"defaultLanguageTag": null,
"identityProviders": [
{
"id": "Facebook-OAuth",
"type": "Facebook",
"name": "Facebook",
"clientId": "clientIdFromFacebook",
"clientSecret": "*******"
}
]
},
{
"id": "B2C_1_CustomerSignIn",
"userFlowType": "signIn",
"userFlowTypeVersion": 1,
"isLanguageCustomizationEnabled": true,
"defaultLanguageTag": "en",
"identityProviders": [
{
"id": "Facebook-OAuth",
"type": "Facebook",
"name": "Facebook",
"clientId": "clientIdFromFacebook",
"clientSecret": "*******"
}
]
}
]
}