Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use POST? #6

Open
vadik12345 opened this issue Aug 25, 2021 · 0 comments
Open

How to use POST? #6

vadik12345 opened this issue Aug 25, 2021 · 0 comments

Comments

@vadik12345
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant