Class: PandaPal::Platform::Canvas
Defined Under Namespace
Modules: OrgExtension
Constant Summary
collapse
- TRUSTED_ISSUERS =
[
"https://sso.canvaslms.com",
"https://sso.beta.canvaslms.com",
"https://sso.test.canvaslms.com",
"https://canvas.instructure.com",
"https://canvas.beta.instructure.com",
"https://canvas.test.instructure.com",
]
Instance Method Summary
collapse
deserialize, from_serialized, organization_api, #public_jwks, resolve_platform, resolve_platform_class, resolve_raw_platform
Constructor Details
#initialize(options) ⇒ Canvas
Returns a new instance of Canvas.
19
20
21
|
# File 'app/models/panda_pal/platform/canvas.rb', line 19
def initialize(options)
@issuer = options[:iss]
end
|
Instance Method Details
#authentication_redirect_url ⇒ Object
31
32
33
|
# File 'app/models/panda_pal/platform/canvas.rb', line 31
def authentication_redirect_url
"#{lti_api_domain}/api/lti/authorize_redirect"
end
|
#grant_url ⇒ Object
35
36
37
|
# File 'app/models/panda_pal/platform/canvas.rb', line 35
def grant_url
"#{lti_api_domain}/login/oauth2/token"
end
|
#is_trusted_env? ⇒ Boolean
39
40
41
42
43
|
# File 'app/models/panda_pal/platform/canvas.rb', line 39
def is_trusted_env?
return true unless Rails.env.production?
TRUSTED_ISSUERS.include?(platform_uri)
end
|
#jwks_url ⇒ Object
27
28
29
|
# File 'app/models/panda_pal/platform/canvas.rb', line 27
def jwks_url
"#{lti_api_domain}/api/lti/security/jwks"
end
|
23
24
25
|
# File 'app/models/panda_pal/platform/canvas.rb', line 23
def platform_uri
@issuer
end
|
#serialize ⇒ Object
45
46
47
|
# File 'app/models/panda_pal/platform/canvas.rb', line 45
def serialize
super.merge(iss: @issuer)
end
|