我正在使用以下命令创建自签名证书。
req -x509 -sha256 -nodes -days 1825 -newkey rsa:2048 -keyout my_key.key -out my_cert.crt -addext "subjectAltName = DNS: FQDN of Machine"
Run Code Online (Sandbox Code Playgroud)
证书创建成功。我还想添加证书的友好名称,我该怎么做?
我想确认ADFS支持oAuth 2.0完全支持oAuth 2.0
ie的所有流程,
三脚oAuth
双腿oAuht
隐含流动
我问这个是因为我尝试使用资源所有者密码流(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;
}
Run Code Online (Sandbox Code Playgroud)
它给了我错误grant_Type=password is not supported.
当我查看ADFS 2012 R2机器事件查看器日志时,它也会出错
"授权服务器不支持请求的'grant_type':'password'.授权服务器当前仅支持'grant_type = authorization_code'."
请帮我怎么实现这个流程?