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

LTIVerifier.verifyParameters cannot work with keys that have multiple values #33

Open
cayhorstmann opened this issue Sep 17, 2017 · 2 comments

Comments

@cayhorstmann
Copy link

A request from Canvas will have keys with multiple values such as

    ext_outcome_data_values_accepted=[url,text]

If you aren't implementing a servlet (e.g. in a Play framework application), you cannot use LTIVerifier.verifyParameters. There is no Map<String, String> that you can pass.

You need to be able to pass a Map<String, String[]> or a similar multi-valued map.

Also, are you including key/value pairs in the url in the verification? If so, it would be good to clearly state that in the docs. If not, that would be a useful service to provide.

@pfgray
Copy link
Contributor

pfgray commented Sep 18, 2017

@cayhorstmann, good point.

The underlying oauth library's API takes a Collection<Entry<String, String>> for the parameter list (which allows for multiple values at the same key).

I'll update the Verifier interface to have an additional method which takes this as a parameter.

something like:

public LtiVerificationResult verifyParameters(Collection<Entry<String, String>> parameters, String url, String method, String secret) throws LtiVerificationException 

does this work for you?

@pfgray
Copy link
Contributor

pfgray commented Sep 18, 2017

Also, to your second question, if parameters are included in the url & in the body, the url passed to LTIVerifier.verifyParameters should include the parameters from the url. They should not be removed from the url and included in the parameter list with the body parameters.

I'll update the javadoc to indicate this

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