** This is just an example **
Very simple authentication service that could be used for lightweight testing.
make build
make run
make tear-down
client_credentials token with elasticcurl -X POST \
http://localhost:8080/token \
-u 'myClientId:myClientSecret' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d grant_type=client_credentials
Typical response:
200 OK
Content-Type: application/json
{
"access_token": "{access_token}",
"token_type": "Bearer",
"expires_in": 3600
}
curl -X GET \
https://elastic.example/api/v1/collections \
-H 'Authorization: Bearer {access_token}'
access_token with elasticThis example service takes a base64 encoded user information object and returns it as the /userinfo request
userinfo object, ex:{
"sub": "test-user-1",
"name": "test user 1",
"email": "[email protected]",
"groups": [
"Sales",
"HR"
]
}
It MUST include sub , all other claims are optional but recommended.
userinfo:USER_INFO=.$(base64 userinfo.json)
curl -k -L -X GET \
https://elastic.example/api/v1/users/me \
-H "Authorization: Bearer $USER_INFO"
Typical response:
{
"id": "Np7UKeHAK4uszngl0Qfd6ODN0YG4zF4W",
"name": "test user 1",
"subject": "simple\\test-user-1",
"tenantId": "_Rz1P3UJ6HoDcDRURz-69kqbTvPPyml5",
"created": "2018-07-13T03:34:40.506Z",
"lastUpdated": "2018-07-13T03:34:40.506Z",
"jwtClaims": {
"userId": "Np7UKeHAK4uszngl0Qfd6ODN0YG4zF4W",
"tenantId": "_Rz1P3UJ6HoDcDRURz-69kqbTvPPyml5",
"subType": "user",
"sub": "simple\\test-user-1",
"groups": [
"Sales",
"HR",
"Everyone"
]
},
"links": {
"self": {
"href": "https://elastic.example:443/api/v1/users/Np7UKeHAK4uszngl0Qfd6ODN0YG4zF4W"
}
}
}
export APP_NAME=$(heroku apps:create --json | jq -r '.name')
make build
heroku container:login
docker tag qlik/simple-auth-svc:latest registry.heroku.com/$APP_NAME/web
docker push registry.heroku.com/$APP_NAME/web
heroku container:release web --app $APP_NAME
echo https://$APP_NAME.herokuapp.com/.well-known/openid-configuration
edge-auth:
secrets:
idpConfigs:
- discoveryUrl: "Use url from previous step"
clientId: "none"
clientSecret: "none"
realm: "simple"
hostname: "elastic.example"
Don't forget to clean up resources once you no longer need the provider:
heroku apps:destroy $APP_NAME --confirm $APP_NAME
Content type
Image
Digest
Size
22.9 MB
Last updated
about 8 years ago
docker pull qlik/simple-auth-svc