Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 1.03 KB

token-exchange.md

File metadata and controls

51 lines (43 loc) · 1.03 KB

Steps

  1. get api2 AT.
export access_token='HERE'
  1. create source RS
cd resource-server
./create-rs.sh -i urn://source.api -n "Source API"   
  1. enable TE on source API
./update-rs.sh -i source.rs.id -f token_exchange -s true

This returns a client_id and client_secret. We'll need them in step 5 and 8

  1. Create target RS
./create-rs.sh -i urn://target.api -n "Target API" -s update:thing,read:thing  
  1. Create Access Policy
cd ../access-policy
./create-access-policy.sh -c <source.api.client.id> -a urn://target.api -s read:thing 
  1. Login with a valid user against. Can JWT.io to receive AT
cd ../login
./authorize.sh -t [email protected] \
    -c <jwt.io-spa-client-id> \
    -R token \
    -a urn://source.api \
    -b firefox -o 
  1. Login and get user's delegated AT

  2. Execute exchange

./token-exchange -t [email protected] \
    -c <source.rs.client.id> \
    -x <source.rs.client.secret> \
    -a urn://target.api
    -s read:thing
    -i <user-AT>