onc-healthit / onc-certification-g10-test-kit

ONC Certification (g)(10) Standardized API Tests
Apache License 2.0
34 stars 13 forks source link

1.3.03 OAuth server sends code parameter No code parameter received #563

Open NarmadaSatishReddy opened 2 months ago

NarmadaSatishReddy commented 2 months ago

https://inferno.healthit.gov/suites/custom/smart/redirect?error=invalid_scope&error_description=Invalid+scopes%3A+launch%2Fpatient+openid+fhirUser+offline_access+patient%2FMedication.read+patient%2FAllergyIntolerance.read+patient%2FCarePlan.read+patient%2FCareTeam.read+patient%2FCondition.read+patient%2FDevice.read+patient%2FDiagnosticReport.read+patient%2FDocumentReference.read+patient%2FEncounter.read+patient%2FGoal.read+patient%2FImmunization.read+patient%2FLocation.read+patient%2FMedicationRequest.read+patient%2FObservation.read+patient%2FOrganization.read+patient%2FPatient.read+patient%2FPractitioner.read+patient%2FProcedure.read+patient%2FProvenance.read+patient%2FPractitionerRole.read&state=e60c629f-6f33-481a-89b6-dde856267d96&iss="https://keycloak.com/realms/test"

However I don't see it is prompting login page at all, it should prompt the login page to get the code right.

This is the previous test case: 1.3.02: https://keycloak.com/realms/test/protocol/openid-connect/auth?response_type=code&client_id=Inferno&redirect_uri=https%3A%2F%2Finferno.healthit.gov%2Fsuites%2Fcustom%2Fsmart%2Fredirect&scope=launch%2Fpatient+openid+fhirUser+offline_access+patient%2FMedication.read+patient%2FAllergyIntolerance.read+patient%2FCarePlan.read+patient%2FCareTeam.read+patient%2FCondition.read+patient%2FDevice.read+patient%2FDiagnosticReport.read+patient%2FDocumentReference.read+patient%2FEncounter.read+patient%2FGoal.read+patient%2FImmunization.read+patient%2FLocation.read+patient%2FMedicationRequest.read+patient%2FObservation.read+patient%2FOrganization.read+patient%2FPatient.read+patient%2FPractitioner.read+patient%2FProcedure.read+patient%2FProvenance.read+patient%2FPractitionerRole.read&state=e60c629f-6f33-481a-89b6-dde856267d96&aud=https%3A%2F%2F0c88-152-58-208-190.ngrok-free.app&code_challenge=qDMS5JznEHWXnYa3Ly_zd_sD8ddUvpmNpEVL4RGMEho&code_challenge_method=S256

Input   Value
standalone_client_id Inferno

standalone_requested_scopes launch/patient openid fhirUser offline_access patient/Medication.read patient/AllergyIntolerance.read patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Device.read patient/DiagnosticReport.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Location.read patient/MedicationRequest.read patient/Observation.read patient/Organization.read patient/Patient.read patient/Practitioner.read patient/Procedure.read patient/Provenance.read patient/PractitionerRole.read

url https://0c88-152-58-208-190.ngrok-free.app

smart_authorization_url https://keycloak.com/realms/test/protocol/openid-connect/auth

use_pkce true

pkce_code_challenge_method S256

output:

Output | Value
standalone_state | e60c629f-6f33-481a-89b6-dde856267d96
pkce_code_verifier | 03812931-2465-456e-a8f4-fb41d0b30b20-cfd29849-e9bb-446c-b86c-001afe4eff
pkce_code_challenge | qDMS5JznEHWXnYa3Ly_zd_sD8ddUvpmNpEVL4RGME
yunwwang commented 2 months ago

@NarmadaSatishReddy The error indicates that the scopes requested by Inferno (those selected during the authorization) are not valid according to the scopes registered for the client. Please double check if the scopes are registered correctly during the client registration or if the server correctly matched scopes requested to the scopes preregistered.