Skip to content

Latest commit

 

History

History

keycloak-jwt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Keycloak JWT Authentication

Deploys the Keycloak Operator and a Keycloak instance and the JWT realm.

Keycloak Operator is installed using the 21.0.1 Keycloak resource.

Retrieve JWT

You can retrieve JWT using the password grant or the client credential approaches.

Password Grant

Example curl to fetch the token through password grant flow

curl -L -s -X POST 'http://localhost:7001/realms/jwt/protocol/openid-connect/token' \
		-H 'Content-Type: application/x-www-form-urlencoded' \
		--data-urlencode 'client_id=keycloak-jwt' \
		--data-urlencode 'grant_type=password' \
		--data-urlencode 'client_secret=wcl7lBoslXBMAHKinMwa1bbEuBQSCUtI' \
		--data-urlencode 'scope=openid' \
		--data-urlencode 'username=default@example.com' \
		--data-urlencode 'password=topsecretpassword'

Client Credentials

Example curl to fetch the token through password grant flow

curl -L -s -X POST 'http://localhost:7001/realms/jwt/protocol/openid-connect/token' \
		-H 'Content-Type: application/x-www-form-urlencoded' \
		--data-urlencode 'client_id=keycloak-jwt' \
		--data-urlencode 'grant_type=client_credentials' \
		--data-urlencode 'client_secret=wcl7lBoslXBMAHKinMwa1bbEuBQSCUtI'

Test Authentication

curl 'http://localhost:8080/keycloak-jwt/get' \
		-H "Authorization: Bearer $token"

Example

./up.sh --deployments keycloak-jwt tyk-stack

Support

Item Status
OpenShift N/A
ARM N/A
CI Tests
Postman Test
SSL N/A

Supported Service Types with --expose flag

Item Status
Port Forward N/A
Ingress N/A
Load Balancer N/A
Icon Description
Supported and tested
⚠️ Not tested
Not supported
Not supported by the tool