如何使用C#中的HTTP请求从Azure App获取授权代码? [英] How to get Authorization Code from Azure App using HTTP Request in C#?

查看:114
本文介绍了如何使用C#中的HTTP请求从Azure App获取授权代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个.Net应用程序,并且要访问某些前景图API,我需要获取访问令牌并获取此访问令牌,我需要授权代码才能通过.就授权代码流的文章而言,我看到了一些示例,在这些示例中,我们可以使用浏览器获取授权代码,而在我的情况下,我想在应用程序中检索授权代码.有什么办法可以做到这一点?

I have created a .Net Application and to access certain outlook graph API's i need to fetch the access token and to get this access token i want authorization code which need to be passed. As far as the article for Authorization Code Flow, I have seen examples where we can get the authorization code by using the browser, whereas, in my case i want to retrieve the auth code within the application. Is there any way we can achieve this?

推荐答案

如何使用C#中的HTTP请求从Azure App获取授权代码?

How to get Authorization Code from Azure App using HTTP Request in C#?

简而言之,不可能.

OAuth 2.0授权流程的一部分如下:

The part of OAuth 2.0 authorization flow is as below:

获取授权码时,用户需要输入凭据和同意权限,这是交互式请求.因此,不可能使用C#代码直接获取代码.

When getting authorization code, user need to enter credential and consent permission which is an Interactive request. So, it's impossible to use C# code getting the code directly.

这篇关于如何使用C#中的HTTP请求从Azure App获取授权代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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