Search code examples
identityserver4angular-auth-oidc-client

Moved my login page, cant login now


I moved my login controls from account/login to the home page and removed the account controller and it's views. It all works fine on my machine (of course) but when I deploy to my test environment I get an error:

No webpage was found for the web address: https://identity.blah.blah/account/login?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Dclient.js%26redirect_uri%3Dhttp%253A%252F%252Fblah.blah%26respons etc

My front end is Angular 6 and Im using angular-auth-oidc-client.

There's nothing in my code that creates this url. The sts server url is just the root uri, no account/login.

{ "stsServer":"https://identity.blah.blah", "redirect_url":"http://app.blah.blah", "client_id":"app.client.js", "response_type":"id_token token", "scope":"openid profile api.v1", "post_logout_redirect_uri":"http://app.blah.blah", "start_checksession":true, "silent_renew":true, "startup_route":"/", "forbidden_route":"/forbidden", "unauthorized_route":"/unauthorized", "log_console_warning_active":true, "log_console_debug_active":false, "max_id_token_iat_offset_allowed_in_seconds":"10" }

Anyone got any ideas? Maybe this is something hard coded somewhere I need to override?


Solution

  • Found it finally. Not the best documentation... :/

    var builder = services.AddIdentityServer(SetupIdentityServer)
    
    private static void SetupIdentityServer(IdentityServerOptions 
      identityServerOptions)
    {
      identityServerOptions.UserInteraction.LoginUrl = "/";
      identityServerOptions.UserInteraction.LogoutUrl = "/Home/Logout";
    }