question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SignOut from OpenID/AzureAD using OWIN causes invalid redirect

See original GitHub issue

Button with following handler supposed to logout from Azure AD authenticated application.

<dot:Button Click="{command: Logout()}" Text="Logout" />
public void Logout()
{
    this.Context.GetOwinContext().Authentication.SignOut(
       OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType);
}

It causes error: DotVVM Debugger: Error XmlHttpRequest failed, maybe internet connection is lost or url is malformed

The redirect URL to (https://login.microsoftonline.com/xxx-xxx-xxx-xxx/oauth2/logout) seems to be sent (judging from the F12 console), but the redirect ends with error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tomashercegcommented, Apr 18, 2017

The sample app is here: https://github.com/riganti/dotvvm-samples-azuread-auth

I am closing the issue. Feel free to reopen this one, or create another one if you hit into any issues.

1reaction
tomashercegcommented, Apr 21, 2017

It is strange - I have received an e-mail notification about a comment, but I cannot see it here.

Here is the comment:

I have looked at the sample and tried it out. I have run into a an issue, that this.Context is being Null in the ViewModel. I just modified the DefaultViewModel constructor, like this

    public DefaultViewModel()
    {
        if (Context != null)
            Title = "Test";
    }

am I missing something, or the OpenIDAuthentication in the OWIN pipe line causes some problems?

My reply:

The Context is always null in the constructor. It is set in the framework right after the constructor is called. Override the Init method and set the Title property there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OWIN OpenId Authentication - Active Session after logout
I am trying to fix a security flaw where the session is not invalidating even after logout. Middleware Implementation: app.
Read more >
Cannot logout from OWIN external identity provider via PKCE
One attempt with the below code to logout. The redirect after logout causes an infinite loop of redirects. The login page never displays....
Read more >
Logout Redirect Page - Questions
Logout redirect causes this error: {“errorCode”:“invalid_client”,“errorSummary”:“Invalid value for 'client_id' parameter.
Read more >
Invalid redirect uri but redirect uri are configured in client
Hi! I'm configuring a client for SSO in Google Workspace using Keycloak as IDP. Everything is working fine with the exception of logout....
Read more >
ASP.NET (OWIN): Login
Configure Callback URLs. The Callback URL of your application is the URL where Auth0 will redirect to after the user has authenticated in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found