Skip to content

Add AdditionalAuthorizationParameters for OAuth/OIDC #39243

@Skulblaka

Description

@Skulblaka

I'm trying to create an app that allows my users to sign in with their Atlassian/Jira account. For this I'm using three-legged OAuth (3LA) as describe in https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/ with ASP.NET Core Identity.

As describe in the beforementioned document, their authorize endpoint requires the parameter audience to be set to api.atlassian.com. (See Implementing OAuth 2.0 (3LO), 1. Direct the user to the authorization URL to get an authorization code)

As far as I can tell from the source of OAuthHandler<>.BuildChallengeUrl(AuthenticationProperties, string), it is not possible to configure the audience parameter of the generated challenge url.

Describe the solution you'd like

I would like to be able to configure the audience parameter using OAuthOptions:

services.AddAuthentication().AddOAuth("Jira", options =>
{
    options.Audience = "api.atlassian.com";
});

Alternativly, a more generic solution I would like is something like a Dictionary<string, string> AdditionalAuthorizationParameters:

services.AddAuthentication().AddOAuth("Jira", options =>
{
    options.AdditionalAuthorizationParameters.Add("audience", "api.atlassian.com");
});

Additional context

Based on my quick research, requiring an audience on the Authorization Endpoint using the Authorization Code Grant does not conform to the OAuth protocol as describe in RFC 6749, however I found that at least Auth0 and Atlassian do so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: DesignThis issue requires design work before implementating.api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-authIncludes: Authn, Authz, OAuth, OIDC, Bearer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions