dylanplecki / KeycloakOwinAuthentication

Keycloak Authentication Middleware for the C# OWIN Pipeline
http://keycloak.jboss.org
MIT License
56 stars 130 forks source link

Single Sign On issue #49

Closed ghost closed 6 years ago

ghost commented 6 years ago

I cloned the sample project twice and called them App1 and App2 to implement SSO using Keycloak. I configured a single Realm in Keycloak with 2 apps, and a Test user with all roles. but whenever I log in from an app, I get a server error from the other! The two apps are in my repository..

Error text: ".... IDX10214: Audience validation failed. Audiences: 'App1'. Did not match: validationParameters.ValidAudience: 'null' or validationParameters.ValidAudiences: 'null, App2'"

ghost commented 6 years ago

I went through the code, and commented out the Audience check... after all, I am using the same token for multiple web apps, shouldn't be restricted to one app! Counterproductive in my case.

j0zeft commented 6 years ago

on the Startup.cs file, you can add the DisableAudienceValidation within the Keycloak configuration and set it to true, it will bypass the Audience check, without messing with the library code.