我想确认ADFS
支持oAuth 2.0
完全支持所有流量oAuth 2.0
i.e.,
三足oAuth
2 足 oAuth
隐式流
我问这个是因为我尝试使用资源所有者密码流(2-legged Oauth)。这是我的代码
using (HttpClient client = new HttpClient())
{
string creds = String.Format("{0}:{1}", "hello@ADFS FQDN", "christ");
byte[] bytes = Encoding.ASCII.GetBytes(creds);
var header = new AuthenticationHeaderValue("Basic",
Convert.ToBase64String(bytes));
client.DefaultRequestHeaders.Authorization = header;
var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>
("grant_type", "password"));
HttpContent content = new FormUrlEncodedContent(postData);
token = client.PostAsync("http://adfs FQDN/adfs/oauth2/token/", content)
.Result.Content.ReadAsStringAsync().Result;
}
它给了我错误grant_Type=password is not supported
.
当我查看 ADFS 2012 R2 计算机事件查看器日志时,它也给出错误:
“授权服务器不支持请求的‘grant_type’:‘password’。授权服务器当前仅支持‘grant_type=authorization_code’。”
请帮助我如何实现这个流程?
AD FS 3.0 (2012 R2) 不支持grant_type=密码对于 OAuth 2.0 但它支持grant_type=授权码 and grant_type=refresh_token仅有的。 AD FS 提供 WS-Trust 端点,您可以使用它们代替 OAuth 2.0 端点来颁发和交换令牌。 WS-Trust 提供不同类型身份验证的端点。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)