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

Cannot connect LtiLauncher to Surfconext OIDC #52

Open
torinfo opened this issue Feb 6, 2022 · 2 comments
Open

Cannot connect LtiLauncher to Surfconext OIDC #52

torinfo opened this issue Feb 6, 2022 · 2 comments

Comments

@torinfo
Copy link

torinfo commented Feb 6, 2022

If I connect LtiLaunche to surfconext, and ask surfconext to give me the name and email of the user, thet information never ends up in the actual LTI launch.

This is because LtiLauncher tries to get the name and email (and sub and picture) from the returned id_token. But the information by default is only available in the userinfo endpoint.

By adding a claims parameter to the authorize endpoint, th name and email are put in the id_token as well, aand everything works like it should. LtiLauncher uses a lot of scopes, but none of that information is used right now, so why not just ask for what is needed.

So the authorize call becomes like this:

uri.query = {
client_id: client_id,
redirect_uri: Rails.application.routes.url_helpers.launch_callback_url,
scope: 'openid',
claims: '{"id_token":{"name":null,"email":null}}',
response_type: 'code',
state: Keypair.jwt_encode(state_payload),
nonce: SecureRandom.uuid
}.to_query

on line 37 of app/models/auth_server.rb

@StefSchenkelaars
Copy link
Contributor

Hi @torinfo, I think that this could be a nice addition. I think this should be quite easy to add. I think it's fine to add a scope column to the auth_servers table and use that one in the redirect.

You feel comfortable doing that in a rails app?

@torinfo
Copy link
Author

torinfo commented Feb 8, 2022

@StefSchenkelaars Hi, apologies. No. I don't know rails at all. I am quite familiar with a lot of differnt programming environments, but rails is not among them. Also, please note, that the claims parameter is the most important one, to make sure that the name and email end up in the login_id token. Otherwise the userinfo endpoint needs to be used to get those two claims from surconext.

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