通过此URI的引用:
http://developer.okta.com/docs/api/resources/oidc.html#parameter-详细信息
我尝试过使用/authorize
端点,但在Okta的结果中没有得到令牌,我总是得到如下结果:
404-找不到页面
找不到您要查找的页面。请转到您的应用程序页面,然后重试
有人能帮我吗?发送电子邮件给Okta开发人员,但我没有得到回复。
var url = "https://xxx-admin.okta.com/oauth2/v1/authorize";
//string urlParams =
// string.Format("response_type={0}&client_id={1}&redirect_uri={2}&scope={3},state={4},nonce={5}", "code",
// "xxxxxx", redirecturl, "email", "email", );
var urlParameters =
$"?idp={"okta"}&response_type={"id_token"}&client_id={"xxxxx"}&redirect_uri={redirecturl}" +
$"&scope={"openid profile email address"}&response_mode={"form_post"}&state={"email"}&nonce={"nonce"}";
string redirecturl = "http://localhost/";
//grant_type,code,refresh_token,scope,redirect_uri,client_id,client_secret
var urlParameters = $"?grant_type={"password"}&code={""}&refresh_token={""}&redirect_uri={redirecturl}&" +
$"client_id=xxxxx&client_secret=yyyyyy";
var url = "https://xxxx-admin.okta.com/oauth2/v1/token";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url+ urlParameters);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
var strRequest= string.Empty;
StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
string strResponse = streamIn.ReadToEnd();
streamIn.Close();
return strResponse.ToString();
看起来您正在为方法执行POST。我认为这应该是一个GET。