Sharebar?

Access token URL

Access token URL

I've created a platform (https://lti-ri.imsglobal.org/platforms/1339) to test my tool and getting stuck at the point where i need to retrieve an access token

When calling the access token url with the request below I get a 500 error with a 'Neither PUB key nor PRIV key: nested asn1 error' and I'm kind of at a loss what the problem is. Could you point me in the right direction?

OpenSSL::PKey::RSAError in AccessTokensController#create
Neither PUB key nor PRIV key: nested asn1 error
Extracted source (around line #55):
# we don't have the private key, so read public key directly
def openssl_tool_public_key
OpenSSL::PKey::RSA.new(tool_public_key)
end
end

Request
Parameters:

{"grant_type"=>"client_credentials",
"client_assertion_type"=>"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"client_assertion"=>
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJydWdnZWRsZWFybmluZyIsInN1YiI6InJ1Z2dlZGxlYXJuaW5nIiwiYXVkIjoiaHR0cHM6Ly9sdGktcmkuaW1zZ2xvYmFsLm9yZy9wbGF0Zm9ybXMvMTMzOS9hY2Nlc3NfdG9rZW5zIiwiaWF0IjoxNjAyNjgwNzE3LCJleHAiOjE2MDI2ODA4NjcsImp0aSI6ImZjNDVkMzgwLWQ3YTAtNGM3Mi1hMjk4LTM5YTgzYzVkODhkZiJ9.Ipj4FAA6j6JRj2UDgfFuGxPakMJECl4Lj7VBreh0pTUfcJZsDYQEy9bkq_Kby5AUqL9pTxq5SLZwwyaQCOWxehQqAPquGeWUK0CIA41v50FZkfq7X_Ga6LILqMeEsuoYD3ui35hc_w6YfC2eW-n7pY09JoZ_ZkDbH2xmHdcZWFAQeomAEN0c_8joGa_3QSxz-gLJarHEgCwRHvLN37bNzuuakzKL5dGp2di1EdOwbSPu1_zxPxQQCr3LZ1DeNOaZlWkYGSHTmhSBZr7soReBk_Dq7_jUXCbAtTg2yHcZTz-UMGJ-9bp_EkN8h8JySrZ89Hs62aydeFOsuPKmKY1thA",
"scope"=>
"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly https://purl.imsglobal.org/spec/lti-ags/scope/score",
"platform_id"=>"1339"}

jrissler's picture

Is your tool something your

Is your tool something your building, or are you trying to get going with reference implementation tool?

This is my own tool that I am

This is my own tool that I am testing with the reference implementation platform.

I tested it with this

I tested it with this platform https://lti-ri.imsglobal.org/platforms/1351/contexts connected to this tool https://lti-ri.imsglobal.org/lti/tools/1353
When i launch a deeplink flow from here: https://lti-ri.imsglobal.org/platforms/1351/contexts. I get the same error..

jrissler's picture

That helps - it looks like

That helps - it looks like your private key (tool) isn't in correct format (pem)- it should looks exactly like https://lti-ri.imsglobal.org/keygen/index including:

-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----

A good first step is to get it working with LTI RI Tool (so you can be sure it's working and the problem isn't with your local tool). I picked a random one that looks correct also, as an example: https://lti-ri.imsglobal.org/lti/tools/1352/edit

Thanks

Thanks it was al in the formatting of the key in the platform configuration..

jrissler's picture

Np at all, glad to help :)

Np at all, glad to help :)