canonical / identity-platform-login-ui

Login UI for the Canonical identity broker and identity provider solution
Apache License 2.0
9 stars 6 forks source link

Device flow POC #211

Closed nsklikas closed 2 months ago

nsklikas commented 7 months ago

POC for Hydra device flow.

To test:

Note

nsklikas commented 3 months ago

To run hydra you need to:

To test the flow run:

code_client=$(hydra create client \
  --endpoint http://localhost:4445 \
  --grant-type authorization_code,refresh_token,urn:ietf:params:oauth:grant-type:device_code \
  --response-type code \
  --format json \
  --scope openid,offline_access,email,profile \
  --redirect-uri http://127.0.0.1:4446/callback \
  --audience app_client \
)
curl -X POST localhost:4444/oauth2/device/auth \
  -d "scope=openid email" \
  -d client_id=`echo "$code_client" | yq .client_id` \
  -u `echo "$code_client" | yq .client_id`:`echo "$code_client" | yq .client_secret`

You can test the token endpoint by running:

curl -X POST localhost:4444/oauth2/token \
  -u "`echo "$code_client" | yq .client_id`:`echo "$code_client" | yq .client_secret`" \
  -d "grant_type=urn:ietf:params:oauth:grant-type:device_code" \
  -d device_code=<device_code>