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

Incorrect get_jwks resulting in no implicit conversion of String into Integer #17

Open
petervtzand opened this issue Dec 30, 2022 · 1 comment

Comments

@petervtzand
Copy link

petervtzand commented Dec 30, 2022

In https://github.com/dmitry-viskov/pylti1.3-flask-example/blob/master/game/app.py#L128 you do

return jsonify({'keys': tool_conf.get_jwks()})

but tool_conf.get_jwks() already returns something like {'keys': <the keys>} (see https://github.com/dmitry-viskov/pylti1.3/blob/master/pylti1p3/tool_config/abstract.py#L117) so this route results into something like

  "keys": {
    "keys": [ ... ] 
  }

So what you should do is just

return jsonify(tool_conf.get_jwks())

For me this resulted in 500 errors while testing deep_linking and names & roles services:
Screenshot 2022-12-30 at 13 57 38

@Chengze-Wu
Copy link

Chengze-Wu commented Feb 1, 2024

I modified the code to:
Please try if it works for you.

@app.route('/jwks/', methods=['GET'])
def get_jwks():
    tool_conf = ToolConfJsonFile(get_lti_config_path())
    # return jsonify({'keys': tool_conf.get_jwks()})
    format_json_str = json.dumps(tool_conf.get_jwks(), separators=(',',':'))
    return format_json_str

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