smart_app_launch_test_kit 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/SMART_RunClientAgainstServer.json.erb +79 -0
  3. data/config/presets/SMART_RunServerAgainstClient_ConfidentialAsymmetric.json.erb +183 -0
  4. data/config/presets/SMART_RunServerAgainstClient_ConfidentialSymmetric.json.erb +157 -0
  5. data/config/presets/SMART_RunServerAgainstClient_Public.json.erb +155 -0
  6. data/lib/smart_app_launch/backend_services_authorization_group.rb +0 -2
  7. data/lib/smart_app_launch/backend_services_authorization_request_success_test.rb +5 -2
  8. data/lib/smart_app_launch/backend_services_authorization_response_body_test.rb +6 -2
  9. data/lib/smart_app_launch/backend_services_invalid_client_assertion_test.rb +1 -1
  10. data/lib/smart_app_launch/backend_services_invalid_jwt_test.rb +1 -1
  11. data/lib/smart_app_launch/client_stu2_2_suite.rb +120 -0
  12. data/lib/smart_app_launch/client_suite/access_alca_interaction_test.rb +75 -0
  13. data/lib/smart_app_launch/client_suite/access_alcs_interaction_test.rb +75 -0
  14. data/lib/smart_app_launch/client_suite/access_alp_interaction_test.rb +75 -0
  15. data/lib/smart_app_launch/client_suite/access_bsca_interaction_test.rb +46 -0
  16. data/lib/smart_app_launch/client_suite/access_group.rb +85 -0
  17. data/lib/smart_app_launch/client_suite/authentication_verification.rb +86 -0
  18. data/lib/smart_app_launch/client_suite/authorization_request_verification_test.rb +108 -0
  19. data/lib/smart_app_launch/client_suite/client_descriptions.rb +114 -0
  20. data/lib/smart_app_launch/client_suite/client_options.rb +35 -0
  21. data/lib/smart_app_launch/client_suite/oidc_jwks.json +32 -0
  22. data/lib/smart_app_launch/client_suite/oidc_jwks.rb +27 -0
  23. data/lib/smart_app_launch/client_suite/registration_alca_group.rb +15 -0
  24. data/lib/smart_app_launch/client_suite/registration_alca_verification_test.rb +57 -0
  25. data/lib/smart_app_launch/client_suite/registration_alcs_group.rb +15 -0
  26. data/lib/smart_app_launch/client_suite/registration_alcs_verification_test.rb +56 -0
  27. data/lib/smart_app_launch/client_suite/registration_alp_group.rb +16 -0
  28. data/lib/smart_app_launch/client_suite/registration_alp_verification_test.rb +50 -0
  29. data/lib/smart_app_launch/client_suite/registration_bsca_group.rb +15 -0
  30. data/lib/smart_app_launch/client_suite/registration_bsca_verification_test.rb +40 -0
  31. data/lib/smart_app_launch/client_suite/registration_verification.rb +58 -0
  32. data/lib/smart_app_launch/client_suite/token_request_alca_verification_test.rb +53 -0
  33. data/lib/smart_app_launch/client_suite/token_request_alcs_verification_test.rb +53 -0
  34. data/lib/smart_app_launch/client_suite/token_request_alp_verification_test.rb +48 -0
  35. data/lib/smart_app_launch/client_suite/token_request_bsca_verification_test.rb +53 -0
  36. data/lib/smart_app_launch/client_suite/token_request_verification.rb +116 -0
  37. data/lib/smart_app_launch/client_suite/token_use_verification_test.rb +40 -0
  38. data/lib/smart_app_launch/docs/demo/FHIR Request.postman_collection.json +81 -0
  39. data/lib/smart_app_launch/docs/smart_stu2_2_client_suite_description.md +208 -0
  40. data/lib/smart_app_launch/endpoints/echoing_fhir_responder_endpoint.rb +96 -0
  41. data/lib/smart_app_launch/endpoints/mock_smart_server/authorization_endpoint.rb +27 -0
  42. data/lib/smart_app_launch/endpoints/mock_smart_server/introspection_endpoint.rb +33 -0
  43. data/lib/smart_app_launch/endpoints/mock_smart_server/smart_authorization_response_creation.rb +30 -0
  44. data/lib/smart_app_launch/endpoints/mock_smart_server/smart_introspection_response_creation.rb +46 -0
  45. data/lib/smart_app_launch/endpoints/mock_smart_server/smart_token_response_creation.rb +250 -0
  46. data/lib/smart_app_launch/endpoints/mock_smart_server/token_endpoint.rb +58 -0
  47. data/lib/smart_app_launch/endpoints/mock_smart_server.rb +278 -0
  48. data/lib/smart_app_launch/metadata.rb +21 -16
  49. data/lib/smart_app_launch/smart_stu2_2_suite.rb +2 -1
  50. data/lib/smart_app_launch/smart_stu2_suite.rb +2 -1
  51. data/lib/smart_app_launch/tags.rb +15 -0
  52. data/lib/smart_app_launch/token_introspection_response_group.rb +1 -1
  53. data/lib/smart_app_launch/token_payload_validation.rb +2 -2
  54. data/lib/smart_app_launch/urls.rb +52 -0
  55. data/lib/smart_app_launch/version.rb +2 -2
  56. data/lib/smart_app_launch_test_kit.rb +1 -0
  57. metadata +45 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbce79e8d195045070c2257dc897fa511b981071d366875bf3aa36ccb338dbdd
4
- data.tar.gz: 5ea51bb46c93c23186fa620908287f69bab62d42c8f5ecbf0ff70d39ec8523e0
3
+ metadata.gz: c85e63b5e23ff0a1021d234660b3878bb14887b5ba3b5fce05ee40f3071bcd28
4
+ data.tar.gz: 962ce6ee409f408ad79093bf424654c0532d741c03666c7902dfb6e5dea93eb8
5
5
  SHA512:
6
- metadata.gz: 7f6d08a9ea9be426cd26e67fcbfa96bc4051b83aa9d38837f77fda2f9715a84e766182993a8e1f725fa945ea9c0bbf68f32155827482d7100036e20f02fd9e97
7
- data.tar.gz: cba999b57e6317c865fc1b98dd56a042b98d2439af5ec8e28ffefd58d52e871513cd7152f640a9d449f1145a870b66ae1fd6d2343376cf0347eb52f8c2373c6d
6
+ metadata.gz: '0491bd7e512cf0c81953e6f3a536bb6f2a0b9a955e7c451b8d3efe85a3d90b1326b54d5846ef3eaa0db5115c89b47326183a56081b4087c739c9ecb10bc4e291'
7
+ data.tar.gz: 10c44261afccf1796a06e3add398dbfa3fcca441364bb7f193afebbe60f120eb6c2c44b3dcd146fe4d0c0ba28a2d5c00a822f2999fb25abd4c8eb2844a08e34a
@@ -0,0 +1,79 @@
1
+ {
2
+ "title": "Demo: Run Against the SMART Server Suite",
3
+ "id": "smart_run_client_against_server_v2_2",
4
+ "test_suite_id": "smart_client_stu2_2",
5
+ "inputs": [
6
+ {
7
+ "name": "client_id",
8
+ "description": "If a particular client id is desired, put it here. Otherwise a default of the Inferno session id will be used.",
9
+ "optional": true,
10
+ "title": "Client Id",
11
+ "type": "text",
12
+ "value": "smart_client_test_demo"
13
+ },
14
+ {
15
+ "name": "smart_launch_urls",
16
+ "description": "A comma-separated list of zero or more URLs that Inferno can use to launch the app. Not needed if the app does not support EHR launch.",
17
+ "optional": true,
18
+ "title": "SMART App Launch URL(s)",
19
+ "type": "textarea",
20
+ "value": "http://localhost:4567/custom/smart_stu2_2/launch"
21
+ },
22
+ {
23
+ "name": "smart_redirect_uris",
24
+ "description": "A comma-separated list of one or more URIs that the app will sepcify as the target of the redirect for Inferno to use when providing the authorization code. These tests can be run without this input, but will not pass without it.",
25
+ "optional": true,
26
+ "title": "SMART App Launch Redirect URI(s)",
27
+ "type": "textarea",
28
+ "value": "http://localhost:4567/custom/smart_stu2_2/redirect"
29
+ },
30
+ {
31
+ "name": "smart_jwk_set",
32
+ "description": "For confidential asymmetric clients, provide the JSON Web Key Set that will be used to sign tokens including the key(s) Inferno will need to verify signatures on token requests made by the client. May be provided as either a publicly accessible url containing the JWKS, or the raw JWKS JSON. Leave blank for public and confidential symmetric clients.",
33
+ "optional": true,
34
+ "title": "SMART Confidential Asymmetric JSON Web Key Set (JWKS)",
35
+ "type": "textarea",
36
+ "value": "http://localhost:4567/custom/smart_stu2_2/.well-known/jwks.json"
37
+ },
38
+ {
39
+ "name": "smart_client_secret",
40
+ "description": "For confidential symmetric clients, provide the client secret that will be provided during token requests to authenticate the client to Inferno. Leave blank for public and confidential asymmetric clients.",
41
+ "optional": true,
42
+ "title": "SMART Confidential Symmetric Client Secret",
43
+ "type": "text",
44
+ "value": "SAMPLE_SECRET"
45
+ },
46
+ {
47
+ "name": "launch_context",
48
+ "description": "Launch context details to be included in access token responses, specified as a JSON array. These contents will be merged into Inferno's token responses.",
49
+ "optional": true,
50
+ "title": "Launch Context",
51
+ "type": "textarea",
52
+ "value": "{ \"patient\": \"example\" }"
53
+ },
54
+ {
55
+ "name": "fhir_user_relative_reference",
56
+ "description": "A FHIR relative reference (<resource type>/<id>) for the FHIR user record to return when the openid and fhirUser scopes are requested. Include this resource in the **Available Resources** input so that it can be accessed.",
57
+ "optional": true,
58
+ "title": "FHIR User Relative Reference",
59
+ "type": "text",
60
+ "value": "Patient/example"
61
+ },
62
+ {
63
+ "name": "fhir_read_resources_bundle",
64
+ "description": "Resources to make available in Inferno's simulated FHIR server provided as a FHIR bundle. Each entry must contain a resource with the id element populated. Each instance present will be available for retrieval from Inferno at the endpoint: <fhir-base>/<resource type>/<instance id>. These are only available through the read interaction.",
65
+ "optional": true,
66
+ "title": "Available Resources",
67
+ "type": "textarea",
68
+ "value": "{\n \"resourceType\": \"Bundle\",\n \"entry\": [\n {\n \"resource\": {\n \"resourceType\": \"Patient\",\n \"id\": \"example\",\n \"name\": [\n {\n \"family\": \"Chalmers\",\n \"given\": [\n \"Peter\",\n \"James\"\n ]\n }\n ],\n \"gender\": \"male\",\n \"birthDate\": \"1974-12-25\",\n \"address\": [\n {\n \"line\": [\n \"534 Erewhon St\"\n ],\n \"city\": \"Ann Arbor\",\n \"state\": \"MI\",\n \"postalCode\": \"48108\"\n }\n ]\n }\n }\n ]\n}"
69
+ },
70
+ {
71
+ "name": "echoed_fhir_response",
72
+ "description": "JSON representation of a default FHIR resource for Inferno to echo when a request is made to the simulated FHIR server. Reads targetting resources in the **Available Resources** input will return that resource instead of this. Otherwise, the content here will be echoed back exactly and no check will be made that it is appropriate for the request made. If nothing is provided, an OperationOutcome will be returned.",
73
+ "optional": true,
74
+ "title": "Default FHIR Response",
75
+ "type": "textarea",
76
+ "value": ""
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,183 @@
1
+ {
2
+ "title": "Demo: Run Against the SMART Client Suite (Confidential Asymmetric)",
3
+ "id": "smart_run_server_against_ca_client_v2_2",
4
+ "test_suite_id": "smart_stu2_2",
5
+ "inputs": [
6
+ {
7
+ "name": "url",
8
+ "description": "URL of the FHIR endpoint used by SMART applications",
9
+ "title": "FHIR Endpoint",
10
+ "type": "text",
11
+ "value": "<%= Inferno::Application['base_url'] %>/custom/smart_client_stu2_2/fhir"
12
+ },
13
+ {
14
+ "name": "standalone_smart_auth_info",
15
+ "options": {
16
+ "mode": "auth",
17
+ "components": [
18
+ {
19
+ "name": "requested_scopes",
20
+ "default": "launch/patient openid fhirUser offline_access patient/*.rs"
21
+ },
22
+ {
23
+ "name": "pkce_support",
24
+ "default": "enabled",
25
+ "locked": true
26
+ },
27
+ {
28
+ "name": "pkce_code_challenge_method",
29
+ "default": "S256",
30
+ "locked": true
31
+ },
32
+ {
33
+ "name": "auth_type",
34
+ "options": {
35
+ "list_options": [
36
+ {
37
+ "label": "Public",
38
+ "value": "public"
39
+ },
40
+ {
41
+ "label": "Confidential Symmetric",
42
+ "value": "symmetric"
43
+ },
44
+ {
45
+ "label": "Confidential Asymmetric",
46
+ "value": "asymmetric"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "use_discovery",
53
+ "locked": true
54
+ },
55
+ {
56
+ "name": "auth_request_method",
57
+ "default": "GET",
58
+ "locked": true
59
+ }
60
+ ]
61
+ },
62
+ "title": "Standalone Launch Credentials",
63
+ "type": "auth_info",
64
+ "value": {
65
+ "pkce_support": "enabled",
66
+ "pkce_code_challenge_method": "S256",
67
+ "auth_request_method": "GET",
68
+ "auth_type": "asymmetric",
69
+ "use_discovery": "true",
70
+ "requested_scopes": "launch/patient openid fhirUser offline_access patient/*.rs",
71
+ "client_id": "smart_client_test_demo",
72
+ "encryption_algorithm": "ES384"
73
+ },
74
+ "default": {}
75
+ },
76
+ {
77
+ "name": "ehr_smart_auth_info",
78
+ "options": {
79
+ "mode": "auth",
80
+ "components": [
81
+ {
82
+ "name": "requested_scopes",
83
+ "default": "launch openid fhirUser offline_access patient/*.rs"
84
+ },
85
+ {
86
+ "name": "pkce_support",
87
+ "default": "enabled",
88
+ "locked": true
89
+ },
90
+ {
91
+ "name": "pkce_code_challenge_method",
92
+ "default": "S256",
93
+ "locked": true
94
+ },
95
+ {
96
+ "name": "auth_type",
97
+ "options": {
98
+ "list_options": [
99
+ {
100
+ "label": "Public",
101
+ "value": "public"
102
+ },
103
+ {
104
+ "label": "Confidential Symmetric",
105
+ "value": "symmetric"
106
+ },
107
+ {
108
+ "label": "Confidential Asymmetric",
109
+ "value": "asymmetric"
110
+ }
111
+ ]
112
+ }
113
+ },
114
+ {
115
+ "name": "use_discovery",
116
+ "locked": true
117
+ },
118
+ {
119
+ "name": "auth_request_method",
120
+ "default": "GET",
121
+ "locked": true
122
+ }
123
+ ]
124
+ },
125
+ "title": "EHR Launch Credentials",
126
+ "type": "auth_info",
127
+ "value": {
128
+ "pkce_support": "enabled",
129
+ "pkce_code_challenge_method": "S256",
130
+ "auth_request_method": "GET",
131
+ "encryption_algorithm": "ES384",
132
+ "auth_type": "asymmetric",
133
+ "use_discovery": "true",
134
+ "requested_scopes": "launch openid fhirUser offline_access patient/*.rs",
135
+ "client_id": "smart_client_test_demo"
136
+ },
137
+ "default": {}
138
+ },
139
+ {
140
+ "name": "backend_services_smart_auth_info",
141
+ "options": {
142
+ "mode": "auth",
143
+ "components": [
144
+ {
145
+ "name": "auth_type",
146
+ "default": "backend_services",
147
+ "locked": "true"
148
+ },
149
+ {
150
+ "name": "use_discovery",
151
+ "locked": true
152
+ }
153
+ ]
154
+ },
155
+ "title": "Backend Services Credentials",
156
+ "type": "auth_info",
157
+ "value": {
158
+ "encryption_algorithm": "ES384",
159
+ "auth_type": "backend_services",
160
+ "use_discovery": "true",
161
+ "requested_scopes": "system/*.rs",
162
+ "client_id": "smart_client_test_demo"
163
+ },
164
+ "default": {}
165
+ },
166
+ {
167
+ "name": "custom_authorization_header",
168
+ "description": "Add custom headers for the introspection request by adding each header's name and value with a new line between each header. Ex: <Header 1 Name>: <Value 1>",
169
+ "optional": true,
170
+ "title": "Custom HTTP Headers for Introspection Request",
171
+ "type": "textarea",
172
+ "value": ""
173
+ },
174
+ {
175
+ "name": "optional_introspection_request_params",
176
+ "description": "Any additional parameters to append to the request body, separated by &. Example: 'param1=abc&param2=def'",
177
+ "optional": true,
178
+ "title": "Additional Introspection Request Parameters",
179
+ "type": "textarea",
180
+ "value": ""
181
+ }
182
+ ]
183
+ }
@@ -0,0 +1,157 @@
1
+ {
2
+ "title": "Demo: Run Against the SMART Client Suite (Confidential Symmetric)",
3
+ "id": "smart_run_server_against_cs_client_v2_2",
4
+ "test_suite_id": "smart_stu2_2",
5
+ "inputs": [
6
+ {
7
+ "name": "url",
8
+ "description": "URL of the FHIR endpoint used by SMART applications",
9
+ "title": "FHIR Endpoint",
10
+ "type": "text",
11
+ "value": "<%= Inferno::Application['base_url'] %>/custom/smart_client_stu2_2/fhir"
12
+ },
13
+ {
14
+ "name": "standalone_smart_auth_info",
15
+ "options": {
16
+ "mode": "auth",
17
+ "components": [
18
+ {
19
+ "name": "requested_scopes",
20
+ "default": "launch/patient openid fhirUser offline_access patient/*.rs"
21
+ },
22
+ {
23
+ "name": "pkce_support",
24
+ "default": "enabled",
25
+ "locked": true
26
+ },
27
+ {
28
+ "name": "pkce_code_challenge_method",
29
+ "default": "S256",
30
+ "locked": true
31
+ },
32
+ {
33
+ "name": "auth_type",
34
+ "options": {
35
+ "list_options": [
36
+ {
37
+ "label": "Public",
38
+ "value": "public"
39
+ },
40
+ {
41
+ "label": "Confidential Symmetric",
42
+ "value": "symmetric"
43
+ },
44
+ {
45
+ "label": "Confidential Asymmetric",
46
+ "value": "asymmetric"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "use_discovery",
53
+ "locked": true
54
+ },
55
+ {
56
+ "name": "auth_request_method",
57
+ "default": "GET",
58
+ "locked": true
59
+ }
60
+ ]
61
+ },
62
+ "title": "Standalone Launch Credentials",
63
+ "type": "auth_info",
64
+ "value": {
65
+ "pkce_support": "enabled",
66
+ "pkce_code_challenge_method": "S256",
67
+ "auth_request_method": "GET",
68
+ "auth_type": "symmetric",
69
+ "use_discovery": "true",
70
+ "requested_scopes": "launch/patient openid fhirUser offline_access patient/*.rs",
71
+ "client_id": "smart_client_test_demo",
72
+ "client_secret": "SAMPLE_SECRET"
73
+ },
74
+ "default": {}
75
+ },
76
+ {
77
+ "name": "ehr_smart_auth_info",
78
+ "options": {
79
+ "mode": "auth",
80
+ "components": [
81
+ {
82
+ "name": "requested_scopes",
83
+ "default": "launch openid fhirUser offline_access patient/*.rs"
84
+ },
85
+ {
86
+ "name": "pkce_support",
87
+ "default": "enabled",
88
+ "locked": true
89
+ },
90
+ {
91
+ "name": "pkce_code_challenge_method",
92
+ "default": "S256",
93
+ "locked": true
94
+ },
95
+ {
96
+ "name": "auth_type",
97
+ "options": {
98
+ "list_options": [
99
+ {
100
+ "label": "Public",
101
+ "value": "public"
102
+ },
103
+ {
104
+ "label": "Confidential Symmetric",
105
+ "value": "symmetric"
106
+ },
107
+ {
108
+ "label": "Confidential Asymmetric",
109
+ "value": "asymmetric"
110
+ }
111
+ ]
112
+ }
113
+ },
114
+ {
115
+ "name": "use_discovery",
116
+ "locked": true
117
+ },
118
+ {
119
+ "name": "auth_request_method",
120
+ "default": "GET",
121
+ "locked": true
122
+ }
123
+ ]
124
+ },
125
+ "title": "EHR Launch Credentials",
126
+ "type": "auth_info",
127
+ "value": {
128
+ "pkce_support": "enabled",
129
+ "pkce_code_challenge_method": "S256",
130
+ "auth_request_method": "GET",
131
+ "encryption_algorithm": "ES384",
132
+ "auth_type": "symmetric",
133
+ "use_discovery": "true",
134
+ "requested_scopes": "launch openid fhirUser offline_access patient/*.rs",
135
+ "client_id": "smart_client_test_demo",
136
+ "client_secret": "SAMPLE_SECRET"
137
+ },
138
+ "default": {}
139
+ },
140
+ {
141
+ "name": "custom_authorization_header",
142
+ "description": "Add custom headers for the introspection request by adding each header's name and value with a new line between each header. Ex: <Header 1 Name>: <Value 1>",
143
+ "optional": true,
144
+ "title": "Custom HTTP Headers for Introspection Request",
145
+ "type": "textarea",
146
+ "value": ""
147
+ },
148
+ {
149
+ "name": "optional_introspection_request_params",
150
+ "description": "Any additional parameters to append to the request body, separated by &. Example: 'param1=abc&param2=def'",
151
+ "optional": true,
152
+ "title": "Additional Introspection Request Parameters",
153
+ "type": "textarea",
154
+ "value": ""
155
+ }
156
+ ]
157
+ }
@@ -0,0 +1,155 @@
1
+ {
2
+ "title": "Demo: Run Against the SMART Client Suite (Public)",
3
+ "id": "smart_run_server_against_p_client_v2_2",
4
+ "test_suite_id": "smart_stu2_2",
5
+ "inputs": [
6
+ {
7
+ "name": "url",
8
+ "description": "URL of the FHIR endpoint used by SMART applications",
9
+ "title": "FHIR Endpoint",
10
+ "type": "text",
11
+ "value": "<%= Inferno::Application['base_url'] %>/custom/smart_client_stu2_2/fhir"
12
+ },
13
+ {
14
+ "name": "standalone_smart_auth_info",
15
+ "options": {
16
+ "mode": "auth",
17
+ "components": [
18
+ {
19
+ "name": "requested_scopes",
20
+ "default": "launch/patient openid fhirUser offline_access patient/*.rs"
21
+ },
22
+ {
23
+ "name": "pkce_support",
24
+ "default": "enabled",
25
+ "locked": true
26
+ },
27
+ {
28
+ "name": "pkce_code_challenge_method",
29
+ "default": "S256",
30
+ "locked": true
31
+ },
32
+ {
33
+ "name": "auth_type",
34
+ "options": {
35
+ "list_options": [
36
+ {
37
+ "label": "Public",
38
+ "value": "public"
39
+ },
40
+ {
41
+ "label": "Confidential Symmetric",
42
+ "value": "symmetric"
43
+ },
44
+ {
45
+ "label": "Confidential Asymmetric",
46
+ "value": "asymmetric"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "use_discovery",
53
+ "locked": true
54
+ },
55
+ {
56
+ "name": "auth_request_method",
57
+ "default": "GET",
58
+ "locked": true
59
+ }
60
+ ]
61
+ },
62
+ "title": "Standalone Launch Credentials",
63
+ "type": "auth_info",
64
+ "value": {
65
+ "pkce_support": "enabled",
66
+ "pkce_code_challenge_method": "S256",
67
+ "auth_request_method": "GET",
68
+ "auth_type": "public",
69
+ "use_discovery": "true",
70
+ "requested_scopes": "launch/patient openid fhirUser offline_access patient/*.rs",
71
+ "client_id": "smart_client_test_demo"
72
+ },
73
+ "default": {}
74
+ },
75
+ {
76
+ "name": "ehr_smart_auth_info",
77
+ "options": {
78
+ "mode": "auth",
79
+ "components": [
80
+ {
81
+ "name": "requested_scopes",
82
+ "default": "launch openid fhirUser offline_access patient/*.rs"
83
+ },
84
+ {
85
+ "name": "pkce_support",
86
+ "default": "enabled",
87
+ "locked": true
88
+ },
89
+ {
90
+ "name": "pkce_code_challenge_method",
91
+ "default": "S256",
92
+ "locked": true
93
+ },
94
+ {
95
+ "name": "auth_type",
96
+ "options": {
97
+ "list_options": [
98
+ {
99
+ "label": "Public",
100
+ "value": "public"
101
+ },
102
+ {
103
+ "label": "Confidential Symmetric",
104
+ "value": "symmetric"
105
+ },
106
+ {
107
+ "label": "Confidential Asymmetric",
108
+ "value": "asymmetric"
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ {
114
+ "name": "use_discovery",
115
+ "locked": true
116
+ },
117
+ {
118
+ "name": "auth_request_method",
119
+ "default": "GET",
120
+ "locked": true
121
+ }
122
+ ]
123
+ },
124
+ "title": "EHR Launch Credentials",
125
+ "type": "auth_info",
126
+ "value": {
127
+ "pkce_support": "enabled",
128
+ "pkce_code_challenge_method": "S256",
129
+ "auth_request_method": "GET",
130
+ "encryption_algorithm": "ES384",
131
+ "auth_type": "public",
132
+ "use_discovery": "true",
133
+ "requested_scopes": "launch openid fhirUser offline_access patient/*.rs",
134
+ "client_id": "smart_client_test_demo"
135
+ },
136
+ "default": {}
137
+ },
138
+ {
139
+ "name": "custom_authorization_header",
140
+ "description": "Add custom headers for the introspection request by adding each header's name and value with a new line between each header. Ex: <Header 1 Name>: <Value 1>",
141
+ "optional": true,
142
+ "title": "Custom HTTP Headers for Introspection Request",
143
+ "type": "textarea",
144
+ "value": ""
145
+ },
146
+ {
147
+ "name": "optional_introspection_request_params",
148
+ "description": "Any additional parameters to append to the request body, separated by &. Example: 'param1=abc&param2=def'",
149
+ "optional": true,
150
+ "title": "Additional Introspection Request Parameters",
151
+ "type": "textarea",
152
+ "value": ""
153
+ }
154
+ ]
155
+ }
@@ -31,8 +31,6 @@ module SMARTAppLaunch
31
31
  ]
32
32
  }
33
33
 
34
- output :bearer_token
35
-
36
34
  test from: :smart_tls,
37
35
  id: :smart_backend_services_token_tls_version,
38
36
  title: 'Authorization service token endpoint secured by transport layer security',
@@ -23,7 +23,7 @@ module SMARTAppLaunch
23
23
  ]
24
24
  }
25
25
 
26
- output :authentication_response
26
+ output :authentication_response, :smart_auth_info
27
27
 
28
28
  run do
29
29
  post_request_content = BackendServicesAuthorizationRequestBuilder.build(
@@ -40,7 +40,10 @@ module SMARTAppLaunch
40
40
 
41
41
  assert_response_status([200, 201])
42
42
 
43
- output authentication_response: authentication_response.response_body
43
+ smart_auth_info.issue_time = Time.now
44
+
45
+ output authentication_response: authentication_response.response_body,
46
+ smart_auth_info: smart_auth_info
44
47
  end
45
48
  end
46
49
  end
@@ -29,7 +29,7 @@ module SMARTAppLaunch
29
29
  }
30
30
  ]
31
31
  }
32
- output :bearer_token, :smart_auth_info
32
+ output :bearer_token, :smart_auth_info, :received_scopes
33
33
 
34
34
  run do
35
35
  skip_if authentication_response.blank?, 'No authentication response received.'
@@ -38,11 +38,15 @@ module SMARTAppLaunch
38
38
  response_body = JSON.parse(authentication_response)
39
39
 
40
40
  access_token = response_body['access_token']
41
+ received_scopes = response_body['scope']
42
+ expires_in = response_body['expires_in']
43
+
41
44
  assert access_token.present?, 'Token response did not contain access_token as required'
42
45
 
43
46
  smart_auth_info.access_token = access_token
47
+ smart_auth_info.expires_in = expires_in
44
48
 
45
- output bearer_token: access_token, smart_auth_info: smart_auth_info
49
+ output bearer_token: access_token, smart_auth_info: smart_auth_info, received_scopes: received_scopes
46
50
 
47
51
  required_keys = ['token_type', 'expires_in', 'scope']
48
52
 
@@ -44,7 +44,7 @@ module SMARTAppLaunch
44
44
 
45
45
  post(smart_auth_info.token_url, **post_request_content)
46
46
 
47
- assert_response_status(400)
47
+ assert_response_status([400, 401])
48
48
  end
49
49
  end
50
50
  end
@@ -55,7 +55,7 @@ module SMARTAppLaunch
55
55
 
56
56
  post(smart_auth_info.token_url, **post_request_content)
57
57
 
58
- assert_response_status(400)
58
+ assert_response_status([400, 401])
59
59
  end
60
60
  end
61
61
  end