dotnet core opeindconnect broken Single Logout(SLO) The Next CEO of Stack OverflowWhat is the correct way to create a single-instance WPF application?Difference between core and processor?What is “.NET Core”?Unable to find Use.RunTimePageInfo() method in startup.cs file in aspnet coreHow to implement ADFS (Single Sign-on) ASP.NET MVC6 (DotNet Core 1.0.0)?502 Error, IIS8 ASP .NET CORE AspNetCore.AntiforgeryWhat is the difference between .NET Core and .NET Standard Class Library project types?Dotnet Core in Ubuntu i686DocuSign.eSign.dll package for dotnet coreKeycloak : Single Logout(SLO)

What day is it again?

Is it professional to write unrelated content in an almost-empty email?

(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Physiological effects of huge anime eyes

Can this note be analyzed as a non-chord tone?

How to Implement Deterministic Encryption Safely in .NET

Which one is the true statement?

What would be the main consequences for a country leaving the WTO?

Graph of the history of databases

Aggressive Under-Indexing and no data for missing index

Easy to read palindrome checker

Why am I getting "Static method cannot be referenced from a non static context: String String.valueOf(Object)"?

Do I need to write [sic] when including a quotation with a number less than 10 that isn't written out?

Is fine stranded wire ok for main supply line?

Expectation in a stochastic differential equation

Expressing the idea of having a very busy time

What steps are necessary to read a Modern SSD in Medieval Europe?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

How to find image of a complex function with given constraints?

Yu-Gi-Oh cards in Python 3

What does "shotgun unity" refer to here in this sentence?

Getting Stale Gas Out of a Gas Tank w/out Dropping the Tank

free fall ellipse or parabola?



dotnet core opeindconnect broken Single Logout(SLO)



The Next CEO of Stack OverflowWhat is the correct way to create a single-instance WPF application?Difference between core and processor?What is “.NET Core”?Unable to find Use.RunTimePageInfo() method in startup.cs file in aspnet coreHow to implement ADFS (Single Sign-on) ASP.NET MVC6 (DotNet Core 1.0.0)?502 Error, IIS8 ASP .NET CORE AspNetCore.AntiforgeryWhat is the difference between .NET Core and .NET Standard Class Library project types?Dotnet Core in Ubuntu i686DocuSign.eSign.dll package for dotnet coreKeycloak : Single Logout(SLO)










0















So i set up a brand new mvc dotnet core app. No security. Then i added open id connect security in the start up like so:



 // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)

var clientId = Configuration["clientID"];
var metadataAddress = Configuration["MetadataAddress"];

var Wtrealm = Configuration["Wtrealm"];
string signedOutCallbackPath = Configuration["SignedOutCallbackPath"];
string postLogoutUrl = Configuration["postLogoutUrl"];

services.AddAuthentication(options =>

options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
)
.AddCookie("Cookies")
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>

options.SaveTokens = true;
options.ClientId = clientId;
options.Authority = metadataAddress;

options.SignedOutCallbackPath = signedOutCallbackPath;


options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");

options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters

NameClaimType = "name",
RoleClaimType = "role",
;

);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);


// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)

if (env.IsDevelopment())

app.UseDeveloperExceptionPage();

else

app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();


app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();

app.UseAuthentication();

app.UseMvc(routes =>

routes.MapRoute(
name: "default",
template: "controller=Home/action=Index/id?");
);



This works for login.
Then I added



 public async Task<IActionResult> Logout(string callBack)

return SignOut("Cookies", OpenIdConnectDefaults.AuthenticationScheme);

public async Task<IActionResult> LogoutComplete()

return View();



Logout to initiate logout and logout to handle the clean up after logout is completed. Logout works for my app. Then it redirects to IdP to logout. It works fine then it redirects browser to LogoutComplete. This is where the weirdness starts: LogoutComplete returns a 302 into the home controller but i don't know why. It never hits the debug point in the method. It does not return the view it is designed t return. This method works fine(returns it's own view) when openIdConnect middleware is not enabled.
Why is this happening? How is this even possible? Why would the middle ware hijack LogoutComplete? Is this in the spec? The openIDProvider was set up in ADFS 2016 and another one in ID Server 4. Both cases the application behaved the same. So i am sure this is not a Provider Configuration/IdP Server issue.










share|improve this question


























    0















    So i set up a brand new mvc dotnet core app. No security. Then i added open id connect security in the start up like so:



     // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)

    var clientId = Configuration["clientID"];
    var metadataAddress = Configuration["MetadataAddress"];

    var Wtrealm = Configuration["Wtrealm"];
    string signedOutCallbackPath = Configuration["SignedOutCallbackPath"];
    string postLogoutUrl = Configuration["postLogoutUrl"];

    services.AddAuthentication(options =>

    options.DefaultScheme = "Cookies";
    options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
    )
    .AddCookie("Cookies")
    .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>

    options.SaveTokens = true;
    options.ClientId = clientId;
    options.Authority = metadataAddress;

    options.SignedOutCallbackPath = signedOutCallbackPath;


    options.Scope.Add("openid");
    options.Scope.Add("profile");
    options.Scope.Add("email");

    options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters

    NameClaimType = "name",
    RoleClaimType = "role",
    ;

    );
    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);


    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)

    if (env.IsDevelopment())

    app.UseDeveloperExceptionPage();

    else

    app.UseExceptionHandler("/Home/Error");
    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
    app.UseHsts();


    app.UseHttpsRedirection();
    app.UseStaticFiles();
    app.UseCookiePolicy();

    app.UseAuthentication();

    app.UseMvc(routes =>

    routes.MapRoute(
    name: "default",
    template: "controller=Home/action=Index/id?");
    );



    This works for login.
    Then I added



     public async Task<IActionResult> Logout(string callBack)

    return SignOut("Cookies", OpenIdConnectDefaults.AuthenticationScheme);

    public async Task<IActionResult> LogoutComplete()

    return View();



    Logout to initiate logout and logout to handle the clean up after logout is completed. Logout works for my app. Then it redirects to IdP to logout. It works fine then it redirects browser to LogoutComplete. This is where the weirdness starts: LogoutComplete returns a 302 into the home controller but i don't know why. It never hits the debug point in the method. It does not return the view it is designed t return. This method works fine(returns it's own view) when openIdConnect middleware is not enabled.
    Why is this happening? How is this even possible? Why would the middle ware hijack LogoutComplete? Is this in the spec? The openIDProvider was set up in ADFS 2016 and another one in ID Server 4. Both cases the application behaved the same. So i am sure this is not a Provider Configuration/IdP Server issue.










    share|improve this question
























      0












      0








      0








      So i set up a brand new mvc dotnet core app. No security. Then i added open id connect security in the start up like so:



       // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)

      var clientId = Configuration["clientID"];
      var metadataAddress = Configuration["MetadataAddress"];

      var Wtrealm = Configuration["Wtrealm"];
      string signedOutCallbackPath = Configuration["SignedOutCallbackPath"];
      string postLogoutUrl = Configuration["postLogoutUrl"];

      services.AddAuthentication(options =>

      options.DefaultScheme = "Cookies";
      options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
      )
      .AddCookie("Cookies")
      .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>

      options.SaveTokens = true;
      options.ClientId = clientId;
      options.Authority = metadataAddress;

      options.SignedOutCallbackPath = signedOutCallbackPath;


      options.Scope.Add("openid");
      options.Scope.Add("profile");
      options.Scope.Add("email");

      options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters

      NameClaimType = "name",
      RoleClaimType = "role",
      ;

      );
      services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);


      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)

      if (env.IsDevelopment())

      app.UseDeveloperExceptionPage();

      else

      app.UseExceptionHandler("/Home/Error");
      // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
      app.UseHsts();


      app.UseHttpsRedirection();
      app.UseStaticFiles();
      app.UseCookiePolicy();

      app.UseAuthentication();

      app.UseMvc(routes =>

      routes.MapRoute(
      name: "default",
      template: "controller=Home/action=Index/id?");
      );



      This works for login.
      Then I added



       public async Task<IActionResult> Logout(string callBack)

      return SignOut("Cookies", OpenIdConnectDefaults.AuthenticationScheme);

      public async Task<IActionResult> LogoutComplete()

      return View();



      Logout to initiate logout and logout to handle the clean up after logout is completed. Logout works for my app. Then it redirects to IdP to logout. It works fine then it redirects browser to LogoutComplete. This is where the weirdness starts: LogoutComplete returns a 302 into the home controller but i don't know why. It never hits the debug point in the method. It does not return the view it is designed t return. This method works fine(returns it's own view) when openIdConnect middleware is not enabled.
      Why is this happening? How is this even possible? Why would the middle ware hijack LogoutComplete? Is this in the spec? The openIDProvider was set up in ADFS 2016 and another one in ID Server 4. Both cases the application behaved the same. So i am sure this is not a Provider Configuration/IdP Server issue.










      share|improve this question














      So i set up a brand new mvc dotnet core app. No security. Then i added open id connect security in the start up like so:



       // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)

      var clientId = Configuration["clientID"];
      var metadataAddress = Configuration["MetadataAddress"];

      var Wtrealm = Configuration["Wtrealm"];
      string signedOutCallbackPath = Configuration["SignedOutCallbackPath"];
      string postLogoutUrl = Configuration["postLogoutUrl"];

      services.AddAuthentication(options =>

      options.DefaultScheme = "Cookies";
      options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
      )
      .AddCookie("Cookies")
      .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>

      options.SaveTokens = true;
      options.ClientId = clientId;
      options.Authority = metadataAddress;

      options.SignedOutCallbackPath = signedOutCallbackPath;


      options.Scope.Add("openid");
      options.Scope.Add("profile");
      options.Scope.Add("email");

      options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters

      NameClaimType = "name",
      RoleClaimType = "role",
      ;

      );
      services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);


      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)

      if (env.IsDevelopment())

      app.UseDeveloperExceptionPage();

      else

      app.UseExceptionHandler("/Home/Error");
      // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
      app.UseHsts();


      app.UseHttpsRedirection();
      app.UseStaticFiles();
      app.UseCookiePolicy();

      app.UseAuthentication();

      app.UseMvc(routes =>

      routes.MapRoute(
      name: "default",
      template: "controller=Home/action=Index/id?");
      );



      This works for login.
      Then I added



       public async Task<IActionResult> Logout(string callBack)

      return SignOut("Cookies", OpenIdConnectDefaults.AuthenticationScheme);

      public async Task<IActionResult> LogoutComplete()

      return View();



      Logout to initiate logout and logout to handle the clean up after logout is completed. Logout works for my app. Then it redirects to IdP to logout. It works fine then it redirects browser to LogoutComplete. This is where the weirdness starts: LogoutComplete returns a 302 into the home controller but i don't know why. It never hits the debug point in the method. It does not return the view it is designed t return. This method works fine(returns it's own view) when openIdConnect middleware is not enabled.
      Why is this happening? How is this even possible? Why would the middle ware hijack LogoutComplete? Is this in the spec? The openIDProvider was set up in ADFS 2016 and another one in ID Server 4. Both cases the application behaved the same. So i am sure this is not a Provider Configuration/IdP Server issue.







      .net core openid-connect






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 17:47









      JuxhinJuxhin

      667




      667






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049976%2fdotnet-core-opeindconnect-broken-single-logoutslo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049976%2fdotnet-core-opeindconnect-broken-single-logoutslo%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved