这个特定的广告流程有什么例子吗? [英] Any example for this specific AD flow?

查看:68
本文介绍了这个特定的广告流程有什么例子吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个示例,可以帮助我进行以下操作:

I am looking for an example that can help me with the following flow:

1)在angularJS客户端中登录表单

1) Sign in form in an angularJS client

2)在.net服务器(不是MVC)中的实际登录,在该服务器中,我们存在登录用户的上下文,以便调用另一个API->

2) Actual sign in in a .net server (not MVC) where we there is context to the user that signed in in order to call another API ->

3)使用从步骤2收到的承载令牌调用Blockchain Workbench API.

3) Call the Blockchain Workbench API with the bearer token that is received from step 2.

我尝试了几次流程,但是我从未获得使我能够调用工作台API的有效承载令牌

I have tried a couple of flows but I never get a valid bearer token that enables me to call the workbench API

例如,我曾经使用过: http://blog.pomiager.com/post/在Azure工作台区块链中使用REST API 它登录了我,但是它的MVC和我想将其分离到angular和C#服务器中的客户端.

For example I have used this: http://blog.pomiager.com/post/using-rest-api-in-azure-workbench-blockchain which signs me in but its MVC and I will like to separate it to a client in angular and a C# server.

这一个 https://github.com/azure-samples/active-directory- dotnet-webapi-onbehalfof 可能会更近一些,但它仍然使用MVP.

This one https://github.com/azure-samples/active-directory-dotnet-webapi-onbehalfof may get closer but its still uses MVP.

谢谢

推荐答案

对于SPA,Microsoft建议使用隐式完整流进行身份验证和授权.您可以进行隐式授权流程.使用隐式流获取令牌,请执行以下步骤:

For SPA Microsoft recommended to use implicit grand flow for authentication and authorization. You can go for implicit grant flow. Getting token using implicit flow follow the below steps:

在您的Azure门户上设置您的回复URL.我已经通过邮递员登录,这就是为什么要输入邮递员回调URL.请参见下面的屏幕截图:

Set Your Reply URL on your azure portal. I have login through postman that's why entered postman callback URL. See the screen shot below:

为此在邮递员上进行测试,以输入必要的信息,如下所示,确保已将身份验证类型选择为OAuth 2.0:

Test On postman for this put your necessary information Like below, Make sure you have selected authentication Type as OAuth 2.0:

作为回应,您将获得令牌,如下所示:

In response you will get your token like below:

您可以使用此令牌访问您的资源.参见以下示例:

You can access your resource with this token. see the below example:

有关更多信息,请参见Microsoft指南 https://docs.microsoft.com/zh-cn/azure/active-directory/develop/v2-oauth2-auth-code-flow

For more information you can see here Microsoft guide line https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

也 GitHub示例 https://github.com/oauthjs/angular-oauth2

also GitHub example https://github.com/oauthjs/angular-oauth2

对于您的应用程序的正确身份验证协议,您可以查看此文档

For Right authentication protocol for your application you can have a look on this document https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-implicit-grant-flow

这篇关于这个特定的广告流程有什么例子吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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