With reference from this URI:
http://developer.okta.com/docs/api/resources/oidc.html#parameter-details
I have tried using the /authorize
endpoint but I am not getting a token back in the result from Okta, I always get the result as:
404 - Page Not Found
The page you are looking for can't be found. Please go to your applications page and try again.
Can anyone help me on this? Sent email to Okta developer but I'm not getting a reply.
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();