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 bypass Available authorizations screen? #4247

Closed
patnolan opened this issue Feb 23, 2018 · 3 comments
Closed

How to bypass Available authorizations screen? #4247

patnolan opened this issue Feb 23, 2018 · 3 comments

Comments

@patnolan
Copy link

When I click the Authorize Button I get the "Available authorizations" dialog for selecting the scope(s) as ecpected. The available scopes are defined in code via AddSecurityDefinition.

However, I would like to bypass this dialog and have the scopes automatically selected. If you have 8 or 10 scopes to check everytime you authorize it can become quite annoying in a dev environment. Could anyone advise how to do this or even provide the necessary code\config?

Thanks heaps!

@patnolan
Copy link
Author

Ok...I worked out that if I add scopes to the OAuthAdditionalQueryStringParams on UseSwaggerUI rather than to the Scopes property on AddSecurityDefinition, the scopes are used without the need for the user to select them on the Available authorizations screen.

However, how can I bypass the Available authorizations screen all together so the user doesn't even see it?

@shockey
Copy link
Contributor

shockey commented Mar 14, 2018

@patnolan, an instance method for programmatically adding authorization data in 3.x is described here: #2915

It's not implemented yet, though.

If you're using Swagger-UI through Swashbuckle, you'd need an interface through Swashbuckle to use the new option, though.

Closing for now - if there's anything else, or I misunderstood something, just reply!

@shockey shockey closed this as completed Mar 14, 2018
@lock
Copy link

lock bot commented Jul 2, 2019

Locking due to inactivity.

This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.

If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.

Thanks!

@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants