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

Having a bit of trouble defining oauth security in config...could I get an example? #14

Open
mephmanx opened this issue Aug 10, 2023 · 0 comments

Comments

@mephmanx
Copy link

mephmanx commented Aug 10, 2023

I have this for config

I have this as import (this is why the name docent match)

from swagger_gen.lib.security import OAuth as SwaggerOAuth

auth_schemes=[SwaggerOAuth(
name='google',
auth_url='https://accounts.google.com/o/oauth2/v2/auth',
scopes=[('openid', 'openid'), ('email', 'email'), ('profile', 'profile')]
)]

And this in metadata

@swagger_metadata(
security='google'
)

But I get this error on server

"Exception on /swagger/v1/swagger.json [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1487, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1506, in finalize_request
response = self.make_response(rv)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1820, in make_response
rv = self.json.response(rv)
File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 215, in response
f"{self.dumps(obj, **dump_args)}\n", mimetype=self.mimetype
File "/usr/local/lib/python3.10/site-packages/flask/json/provider.py", line 180, in dumps
return json.dumps(obj, **kwargs)
File "/usr/local/lib/python3.10/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/usr/local/lib/python3.10/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.10/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
TypeError: keys must be str, int, float, bool or None, not tuple"

Im sure Im missing something...advice?

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