Asp.net核心Web和API的Azure B2C身份验证 [英] Azure B2C Authentication for Asp.net core Web and API

查看:107
本文介绍了Asp.net核心Web和API的Azure B2C身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我创建了一个asp.net核心网络和API项目,并在我的B2C Active目录中注册,我可以在asp.net核心web并根据我的B2C用户流配置获取令牌。现在,我想访问asp.net
核心API(通过B2C活动目录保护)。 

I have created a asp.net core web and API projects and registered with my B2C Active directory and I am able to do the authentication in the asp.net core web and getting the token based on my B2C user flow configuration. Now, I want to access the asp.net core API (which is secured through B2C active directory). 

请告诉我如何创建访问令牌访问API?我想在API中获取用户信息。 

Please let me know how do I create the access token to access the API ? I want to get the user information also in the API. 

谢谢,

Selva

    

   

Selvakumar Rathinam

Selvakumar Rathinam

推荐答案


Selvakumar Rathinam

Azure Active Directory(Azure AD)B2C是一种身份管理服务,可让您自定义和控制客户签名方式使用您的应用程序时,注册,登录并管理其配置文件。根据您的要求,您可以从AD B2C获取令牌
,并且您希望使用该令牌来验证web api,它也称为代表流。根据

文档
,Azure AD B2C中当前未实现代表流。 
$


但是您可以使用Azure实现功能广告也。请检查以下文档以代表流程。

Azure Active Directory (Azure AD) B2C is an identity management service that enables you to customize and control how customers sign up, sign in, and manage their profiles when using your applications. As per your requirement, you are able to get the token from AD B2C and you want to use that token to authenticate web api, it's also called on-behalf-of flow. As per the document, the on-behalf-of flow is not currently implemented in the Azure AD B2C. 

But you can achieve your functionality with Azure AD also. Please check the below documentation for on-behalf-of flow.

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow

我希望这会有所帮助。

谢谢。



这篇关于Asp.net核心Web和API的Azure B2C身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆