Open vadik12345 opened 3 years ago
Hello,
If I use default value of ProviderOptions.ResponseType then following code works:
private static void ConfigureServices(this IServiceCollection services, IConfiguration config) { services.AddAuth0Authentication(options => { options.ProviderOptions.Audience = config["Authentication:Audience"]; options.ProviderOptions.Authority = config["Authentication:Authority"]; options.ProviderOptions.ClientId = config["Authentication:ClientId"]; options.ProviderOptions.ResponseType = "token id_token"; options.ProviderOptions.RedirectUri = "authentication/login-callback"; options.ProviderOptions.PostLogoutRedirectUri = "authentication/logout-callback"; options.ProviderOptions.DefaultScopes.Add("email"); options.AuthenticationPaths.LogOutSucceededPath = "/"; foreach (var permission in Permission.List) { options.ProviderOptions.DefaultScopes.Add(permission.Value); } }).AddAccountClaimsPrincipalFactory<AfoConnectPrincipalFactory>(); .... }
But if I tried to use options.ProviderOptions.ResponseType = "post_form"; then there is problem. private static void ConfigureServices(this IServiceCollection services, IConfiguration config) { services.AddAuth0Authentication(options => { options.ProviderOptions.Audience = config["Authentication:Audience"]; options.ProviderOptions.Authority = config["Authentication:Authority"]; options.ProviderOptions.ClientId = config["Authentication:ClientId"]; options.ProviderOptions.ResponseType = "token id_token"; options.ProviderOptions.RedirectUri = "authentication/login-callback"; options.ProviderOptions.PostLogoutRedirectUri = "authentication/logout-callback"; options.ProviderOptions.DefaultScopes.Add("email"); options.AuthenticationPaths.LogOutSucceededPath = "/"; options.ProviderOptions.ResponseType = "post_form";
foreach (var permission in Permission.List) { options.ProviderOptions.DefaultScopes.Add(permission.Value); } }).AddAccountClaimsPrincipalFactory<AfoConnectPrincipalFactory>();
... }
How to use POST method?
Thank you.
Hello,
If I use default value of ProviderOptions.ResponseType then following code works:
But if I tried to use options.ProviderOptions.ResponseType = "post_form"; then there is problem. private static void ConfigureServices(this IServiceCollection services, IConfiguration config) { services.AddAuth0Authentication(options => { options.ProviderOptions.Audience = config["Authentication:Audience"]; options.ProviderOptions.Authority = config["Authentication:Authority"]; options.ProviderOptions.ClientId = config["Authentication:ClientId"]; options.ProviderOptions.ResponseType = "token id_token"; options.ProviderOptions.RedirectUri = "authentication/login-callback"; options.ProviderOptions.PostLogoutRedirectUri = "authentication/logout-callback"; options.ProviderOptions.DefaultScopes.Add("email"); options.AuthenticationPaths.LogOutSucceededPath = "/"; options.ProviderOptions.ResponseType = "post_form";
... }
How to use POST method?
Thank you.