You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// This class contains all header names that are possible to make an authentication.
5
+
/// The source of the list can find here: https://docs.microsoft.com/en-us/azure/app-service/app-service-authentication-how-to#retrieve-tokens-in-app-code
varidentity=newGenericIdentity(principalName,AuthenticationTypesNames.Federation);// setting ClaimsIdentity.AuthenticationType to value that azuread non-easyauth setups use
// build up identity from X-MS-TOKEN-AAD-ID-TOKEN header set by EasyAuth filters if user openid connect session cookie or oauth bearer token authenticated ...
this.Logger.LogDebug("payload was fetched from easyauth headers, name: {0}",name);
95
-
96
-
varidentity=newGenericIdentity(name,"AuthenticationTypes.Federation");// setting ClaimsIdentity.AuthenticationType to value that azuread non-easyauth setups use
97
-
98
-
this.Logger.LogInformation("building claims from payload...");
this.Logger.LogInformation("Add claims to new identity");
128
-
129
-
identity.AddClaims(claims);
130
-
//identity.AddClaim(new Claim("id_token", idToken)); // don't think we should be including this
131
-
//identity.AddClaim(new Claim("http://schemas.microsoft.com/claims/authnclassreference", 1)); // don't think we need to add this
132
-
if(!(identity.ClaimsasList<Claim>).Exists(claim =>claim.Type=="scp"))identity.AddClaim(newClaim("scp","user_impersonation"));// not sure why easyauth is dropping this
this.Logger.LogDebug("payload was fetched from easyauth me json, name: {0}",name);
142
-
143
-
varidentity=newGenericIdentity(name,"AuthenticationTypes.Federation");// setting ClaimsIdentity.AuthenticationType to value that azuread non-easyauth setups use
144
-
145
-
this.Logger.LogInformation("building claims from payload...");
this.Logger.LogInformation("Add claims to new identity");
173
-
174
-
identity.AddClaims(claims);
175
-
//identity.AddClaim(new Claim("id_token", idToken)); // don't think we should be including this
176
-
//identity.AddClaim(new Claim("http://schemas.microsoft.com/claims/authnclassreference", 1)); // don't think we need to add this
177
-
if(!(identity.ClaimsasList<Claim>).Exists(claim =>claim.Type=="scp"))identity.AddClaim(newClaim("scp","user_impersonation"));// not sure why easyauth is dropping this
this.Logger.LogDebug("found {0} cookies in request",cookieContainer.Count);
197
-
198
-
foreach(varcookieinthis.Context.Request.Cookies)
199
-
{
200
-
this.Logger.LogDebug(cookie.Key);
201
-
}
202
-
203
-
// fetch value from endpoint
204
-
varauthMeEndpoint=string.Empty;
205
-
if(this.Options.AuthEndpoint.StartsWith("http"))authMeEndpoint=this.Options.AuthEndpoint;// enable pulling from places like storage account public blob container
206
-
elseauthMeEndpoint=$"{uriString}/{this.Options.AuthEndpoint}";// localhost relative path, e.g. wwwroot/.auth/me.json
0 commit comments