Closed apoorvdixit88 closed 6 days ago
/auth/select
Closes #5127
If request from id that has auth type as open_id_connect:
open_id_connect
curl --location 'http://localhost:8080/user/auth/select' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer SPT' \ --header 'Cookie: Cookie_1=value' \ --data '{ "id":"f20742d2-f1b8-4dad-8b2d-cf8fe6d457eb" }'
response will contain token type as sso
sso
{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYjJkNjMxZDUtMGQzMi00Y2IxLTg2MTQtNWVlNWI2MDczYTVkIiwicHVycG9zZSI6InNzbyIsIm9yaWdpbiI6ImFjY2VwdF9pbnZpdGF0aW9uX2Zyb21fZW1haWwiLCJwYXRoIjpbImF1dGhfc2VsZWN0Il0sImV4cCI6MTcxOTU4NDc2NX0.ChD9An8L4szVjLn9Q51otVOXOuZf8kdgRMmH865lQQI", "token_type": "sso" }
If request from id other than open_id_connect
curl --location 'http://localhost:8080/user/auth/select' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer SPT' \ --header 'Cookie: Cookie_1=value' \ --data '{ "id":"65ff02eb-f3dc-4afc-b8ac-cef2a30c4d12" }'
Response will contain token type as totp
totp
{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYjJkNjMxZDUtMGQzMi00Y2IxLTg2MTQtNWVlNWI2MDczYTVkIiwicHVycG9zZSI6InRvdHAiLCJvcmlnaW4iOiJhY2NlcHRfaW52aXRhdGlvbl9mcm9tX2VtYWlsIiwicGF0aCI6WyJhdXRoX3NlbGVjdCJdLCJleHAiOjE3MTk1ODQ5MDl9.hEBp49fycxiSW1VoyPR6s9TISO4lQKP3ta0S4SH3C9s", "token_type": "totp" }
Db entries for correponding request ids:
cargo +nightly fmt --all
cargo clippy
Type of Change
Description
/auth/select
to terminate auth selectAdditional Changes
Motivation and Context
Closes #5127
How did you test it?
If request from id that has auth type as
open_id_connect
:response will contain token type as
sso
If request from id other than
open_id_connect
Response will contain token type as
totp
Db entries for correponding request ids:![Screenshot 2024-06-26 at 7 59 41 PM](https://github.com/juspay/hyperswitch/assets/64925866/0634150a-91c8-4cfa-bfe3-3412eba7f151)
Checklist
cargo +nightly fmt --all
cargo clippy