-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redirect URI https://localhost:44343/authorization-code/callback returns HTTP Error 404.0 - Not Found #63
Comments
Hi @jayheavner, Can you please provide more details of your use case? What sample app are you working on (okta-hosted, self-hosted, etc)? Would you mind sharing your Startup class? (Make sure to mask your secrets). |
I’m using the Okta-hosted sample app. Like I said, the sample app works
fine but when I move the code to my application I get the 404. I’m using a
CMS called Kentico. It’s still using 4.8 and web forms. It may be doing
something in its middleware to handling routing, I don’t know. My startup
class should be fine. It’s identical to the one in the sample app that is
working. I can post it in the morning. It seems like you’re calling this
thing web forms but it’s really more MVC. Installing OWIN to use it doesn’t
seem very web forms. I get that pattern is out-dated but that’s what I’m
stuck with.
On Mon, May 30, 2022 at 3:16 PM Laura Rodríguez ***@***.***> wrote:
Hi @jayheavner <https://github.com/jayheavner>,
Can you please provide more details of your use case? What sample app are
you working on (okta-hosted, self-hosted, etc)? Would you mind sharing your
Startup class? (Make sure to mask your secrets).
—
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAY53PGNNQ6OYAKSMBBFK2TVMUH2LANCNFSM5XLLBIMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Jay Heavner
|
See attached for my startup class and login handler.
Here are web.config key/values.
<appSettings>
....
<add key="okta:ClientId" value="xxxxxxx" />
<add key="okta:ClientSecret" value="xxxxxxxxx" />
<add key="okta:OktaDomain" value="https://xxx.okta.com" />
<add key="okta:AuthorizationServerId" value="default" />
<add key="okta:RedirectUri" value="
https://localhost:44433/authorization-code/callback" />
<add key="okta:PostLogoutRedirectUri" value="https://localhost:44433" />
....
</appSettings>
…On Mon, May 30, 2022 at 11:27 PM Jay Heavner ***@***.***> wrote:
I’m using the Okta-hosted sample app. Like I said, the sample app works
fine but when I move the code to my application I get the 404. I’m using a
CMS called Kentico. It’s still using 4.8 and web forms. It may be doing
something in its middleware to handling routing, I don’t know. My startup
class should be fine. It’s identical to the one in the sample app that is
working. I can post it in the morning. It seems like you’re calling this
thing web forms but it’s really more MVC. Installing OWIN to use it doesn’t
seem very web forms. I get that pattern is out-dated but that’s what I’m
stuck with.
On Mon, May 30, 2022 at 3:16 PM Laura Rodríguez ***@***.***>
wrote:
> Hi @jayheavner <https://github.com/jayheavner>,
>
> Can you please provide more details of your use case? What sample app are
> you working on (okta-hosted, self-hosted, etc)? Would you mind sharing your
> Startup class? (Make sure to mask your secrets).
>
> —
> Reply to this email directly, view it on GitHub
> <#63 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAY53PGNNQ6OYAKSMBBFK2TVMUH2LANCNFSM5XLLBIMA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
Jay Heavner
--
Jay Heavner
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.OpenIdConnect;
using System;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
namespace CMSApp.CMSPages
{
public partial class OktaLogin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Request.IsAuthenticated)
{
HttpContext.Current.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = "/" },
OpenIdConnectAuthenticationDefaults.AuthenticationType);
}
else
{
var claims = HttpContext.Current.GetOwinContext().Authentication.User.Claims.Select(x => new { Name = x.Type, Value = x.Value }).ToList();
var claim = claims.FirstOrDefault(c => c.Name.Equals("email", StringComparison.CurrentCultureIgnoreCase));
if (claim != null)
CMS.Membership.AuthenticationHelper.AuthenticateUser(claim.Value, true, false);
}
}
}
}
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Okta.AspNet;
using Owin;
using System.Collections.Generic;
using System.Configuration;
[assembly: OwinStartup(typeof(CMSApp.OktaStartup))]
namespace CMSApp
{
public class OktaStartup
{
public void Configuration(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOktaMvc(new OktaMvcOptions()
{
OktaDomain = ConfigurationManager.AppSettings["okta:OktaDomain"],
ClientId = ConfigurationManager.AppSettings["okta:ClientId"],
ClientSecret = ConfigurationManager.AppSettings["okta:ClientSecret"],
AuthorizationServerId = ConfigurationManager.AppSettings["okta:AuthorizationServerId"],
RedirectUri = ConfigurationManager.AppSettings["okta:RedirectUri"],
PostLogoutRedirectUri = ConfigurationManager.AppSettings["okta:PostLogoutRedirectUri"],
GetClaimsFromUserInfoEndpoint = true,
Scope = new List<string> { "openid", "profile", "email" },
});
}
}
}
|
Is this redirectURI should be replaced or can I leave it? can i modify those |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using this with Kentico 13 and that's where I'm getting the error. If I do a vanilla asp.net website it works ok.
I have my redirect URI configured properly in my application. /authorization-code/callback is hardcoded into the package and cannot be change. I'm not getting a browser 404 but rather the IIS 10 Detailed Error page 404. How do I debug this?
The text was updated successfully, but these errors were encountered: