-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
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.