GithubHelp home page GithubHelp logo

claudevervoort / ltibootcamp Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 9.0 3.22 MB

License: Apache License 2.0

Python 63.05% Jupyter Notebook 33.51% HTML 2.06% CSS 0.16% Shell 0.53% Dockerfile 0.70%

ltibootcamp's Issues

AttributeError: 'str' object has no attribute 'decode'

When running

auth_request_params = {
    'scope': 'open_id', #we only use the flow for OIDC, not to get an access token
    'response_type': 'id_token',
    'client_id': tool_info['client_id'],
    'login_hint': init_login_request['login_hint'],
    'lti_message_hint': init_login_request['lti_message_hint'],
    'response_mode': 'form_post', # with LTI we expect the user to already have a session in the platform
    'nonce': nonce, #a nonce compared to state should fail if replayed
    'state': orig_state, #state is optional
    'redirect_uri': redirect_uri
}

autopost_iframe('deeplinking', tool_info['oidc_auth_endpoint'], auth_request_params)

I get


AttributeError

AttributeError: 'str' object has no attribute 'decode'
Traceback (most recent call last)

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 2091, in __call__

    return self.wsgi_app(environ, start_response)

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app

    response = self.handle_exception(e)

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app

    response = self.full_dispatch_request()

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request

    rv = self.dispatch_request()

    File "/home/hugo/ws/serlo/lti/ltibootcamp/.venv/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request

    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)

    File "/home/hugo/ws/serlo/lti/ltibootcamp/server/lti_platform.py", line 82, in oidc_authorization

    return render_template('postauthresponse.html', redirect_uri=redirect_uri, state=state, id_token=id_token.decode('utf-8'))

    AttributeError: 'str' object has no attribute 'decode'

The only way to get the id_token for the next block is printing it in the terminal.

Python 3.8.10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.