-
Notifications
You must be signed in to change notification settings - Fork 259
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
Usage Question: ROPCAccessToken usage causes assert req["grant_type"] == "authorization_code" assert error #615
Comments
It should probably be a If you used the https://github.com/OpenIDC/pyoidc/blob/master/src/oic/extension/provider.py |
Thank you very much for your answer, that helped me towards the right path. I have a few folowup questions:
Here is the function where it checks for the "access_token" member (oic.extension.provider)
And the call stack:
Thank you in advance for your help |
Ad 1) As far as I can tell, it should be possible. Whether it is in fact implemented properly is another question :) Bug reports and/or pull requests are welcomed! |
Thank you for the answers. Here is the dump of the areq taken from inside the password_grant_type method: { Thank you for your help |
Looks OK. How about |
Sure, here are the contents of those variables: _at="eyJhbGciOiJSUzI1NiIsImtpZCI6InRwN2dJUGwtTFlkekRNbXRpQkNnbWcxVHBLWGVJUFRScU9Edmp1QjFzb3cifQ.eyJpc3MiOiAiaHR0cHM6Ly9sb2NhbGhvc3QvIiwgImlhdCI6IDE1NTEwODI3NTcsICJleHAiOiAxNTUxMDgzMzU3LCAia2lkIjogInRwN2dJUGwtTFlkekRNbXRpQkNnbWcxVHBLWGVJUFRScU9Edmp1QjFzb3ciLCAianRpIjogIlQtN2EwMzc1ZTQwMGUxNDZhZGIyMDNlYzY4ZGRmNTBmYWMiLCAic2NvcGUiOiAib3BlbmlkIHByb2ZpbGUiLCAiYXVkIjogWyJteE9WMVQ1RFFYRFIiXSwgImF6cCI6ICJteE9WMVQ1RFFYRFIifQ.xVLEdsyWcjJUks3y5l_eUItUAK08QJfMSWCZB_gYiaUbgWifnrc0RIvH8BPaKEbxoYMR3GbJzbwOnA-M5KHHhwhI3ivtJ787ZBBRR5Fq3BCa6Lmlqh2-nTpDGgJFXMy3BVx7_EoA2wTXayOTnUVW_PjWVZqvQrpo787_fQyasx7oUKzfkU47JKvbZH7K-cuh6ni5Wfv9GL581PXqY96fuPlzAQYG-4YCPiwKvgjsc0OKCoW-9LPvD45mkgsF8vZqddtLJTRwbqpuEDXqb1H1J6s0D0AOBJipi0Tthyl7WZdknLJyNJ8azzhFFLUwDJWm1fe7GPsvt2d4iAt5p28Hqw" _info = { The _info does not have a "access_token" member causing an exception to be thrown, excepion of type KeyError which is not caught. |
I haven't touched the extension library in ages. Must be at least 4-5 years. Yes, I would call it a bug. |
@rohe Thanks! I will try to have a look and get them in sync. |
The extension part looks quite a lot of out of sync and it will take come effort to bring them back together. I will probably try to clean up the duplicates first and then focus on writing tests and fixing the implementation. |
I have attempted a simple fix in |
Hi, I'm trying to get the Resource Ownger Password Credentials Grant working and i'm getting an error. When i'm trying to run the following code
I get the following assert error. Can anyone please guide me on what i am doing wrong in trying to get a token using the Password Grant Flow?
Traceback (most recent call last): File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask_restful\__init__.py", line 269, in error_router return original_handler(e) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\_compat.py", line 34, in reraise raise value.with_traceback(tb) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask_restful\__init__.py", line 269, in error_router return original_handler(e) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\_compat.py", line 34, in reraise raise value.with_traceback(tb) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask_restful\__init__.py", line 458, in wrapper resp = resource(*args, **kwargs) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask\views.py", line 88, in view return self.dispatch_request(*args, **kwargs) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\flask_restful\__init__.py", line 573, in dispatch_request resp = meth(*args, **kwargs) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\src\OP.py", line 102, in post authn=request.headers.environ['HTTP_AUTHORIZATION'] File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\oic\oic\provider.py", line 1115, in token_endpoint return self._access_token_endpoint(req, **kwargs) File "C:\Users\bogdan\Projects\Learning\Python\oidc\OP\venv\lib\site-packages\oic\oic\provider.py", line 964, in _access_token_endpoint assert req["grant_type"] == "authorization_code" AssertionError
The text was updated successfully, but these errors were encountered: