Initial Release
This is a sample application that demonstrates how to use the InterSystems IRIS for Health FHIR Repository to build a FHIR Repository with OAuth2 authorization, the FHIR endpoint will be the resource server and Google OpenId will be the authorization server.
This part is inspired by the article Adding Google Social Login into InterSystems Management Portal from yurimarx Marx in the InterSystems Community.
Create a new project in Google Cloud Platform
On the header click Select a project:
We will be using postman for the demo, but if you want to use the sample application, you will need to add the following redirect URIs, same goes for the JavaScript origins.
You are done with the Google Cloud Platform configuration.
git clone https://github.com/grongierisc/iris-oauth-fhir
docker-compose build
secret.json
in misc/auth
folder, you can use the secret.json.template
as a template.{
"web": {
"client_id": "xxxx",
"project_id": "intersystems-iris-fhir",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v3/certs",
"client_secret": "xxxx"
},
"other" : {
"issuer" : "accounts.google.com"
}
}
⚠️ Warning : auth_provider_x509_cert_url
by default is https://www.googleapis.com/oauth2/v1/certs
but it is deprecated, you need to use https://www.googleapis.com/oauth2/v3/certs
instead.
docker-compose up -d
⚠️ Warning : if the secret.json
file is not present, the docker image will start in a unauthenticated mode.
The endpoint is httsp://localhost:4443/fhir/r4/
.
Configure Postman to use the self-signed certificate, see Postman documentation.
Create a new request in Postman and go to the Authorization tab. Select OAuth 2.0 as the type :
The access url token is : https://accounts.google.com/o/oauth2/token
Scopes is : openid
Client Id and Client Secret are the one you got from the Google Cloud Platform.
What journey, hope you enjoyed it.
More to come, stay tuned. We will be dealing with kubernetes and the FHIR repository in the next part.