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

Scope separator #542

Closed
imperugo opened this issue Oct 27, 2015 · 1 comment
Closed

Scope separator #542

imperugo opened this issue Oct 27, 2015 · 1 comment

Comments

@imperugo
Copy link

Hi,
right now I saw in the javascript that the scope separator is the , but could be great to parametrize it with something chose by the user.
The current output is like this:

if (typeof initOAuth == "function" && swashbuckleConfig.oAuth2Enabled) {
    initOAuth({
      clientId: swashbuckleConfig.oAuth2ClientId,
      clientSecret: swashbuckleConfig.oAuth2ClientSecret,
      realm: swashbuckleConfig.oAuth2Realm,
      appName: swashbuckleConfig.oAuth2AppName,
      scopeSeparator: ","
    });
}

Some oauth server uses the space instead of the comma to separate the scopes
Maybe something like this

c.OAuth2("oauth2")
    .Description("OAuth2 Implicit Grant")
    .Flow("implicit")
    .AuthorizationUrl(authorizationUrl)
    .ScopeSeparator(" ")
    .Scopes(scopes => ....

with this output:

if (typeof initOAuth == "function" && swashbuckleConfig.oAuth2Enabled) {
    initOAuth({
      clientId: swashbuckleConfig.oAuth2ClientId,
      clientSecret: swashbuckleConfig.oAuth2ClientSecret,
      realm: swashbuckleConfig.oAuth2Realm,
      appName: swashbuckleConfig.oAuth2AppName,
      scopeSeparator: " "
    });
}

Does it make sense?

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

2 participants