|
| 1 | +// ===== BASICS |
| 2 | +// Get OpenID Connect Metadata |
| 3 | +GET https://login.microsoftonline.com/rainertimecockpit.onmicrosoft.com/v2.0/.well-known/openid-configuration |
| 4 | + |
| 5 | +// Get ID Token |
| 6 | +GET https://login.microsoftonline.com/022e4faf-c745-475a-be06-06b1e1c9e39d/oauth2/v2.0/authorize?client_id=4cc39076-555a-48f5-bdb8-c9fc8134a35f&response_type=id_token&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&response_mode=form_post&scope=openid&state=12345&nonce=678910 |
| 7 | + |
| 8 | + |
| 9 | +// ===== CODE GRANT FLOW |
| 10 | +// Get Code (Code Grant Flow) |
| 11 | +GET https://rainerdemo.eu.auth0.com/authorize?client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&response_type=code&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&response_mode=query&scope=openid%20offline_access&state=12345 |
| 12 | + |
| 13 | +// Get Token from Code |
| 14 | +POST https://rainerdemo.eu.auth0.com/oauth/token |
| 15 | +Content-Type: application/x-www-form-urlencoded |
| 16 | + |
| 17 | +client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&scope=openid%20offline_access&code=DtoirWzOBAxXXqGO&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&grant_type=authorization_code&client_secret=-oAiMEyVXlmW_jQ9YYLdJwRZt7gppB7DZapNT2BRzEfafAyJ5Z2Lug-DdDGdCx50 |
| 18 | + |
| 19 | +// Get Code with Scope |
| 20 | +GET https://rainerdemo.eu.auth0.com/authorize?client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&response_type=code&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&response_mode=query&audience=http%3A%2F%2Foidc-webapi%2F&scope=openid%20offline_access%20read:data&state=12345 |
| 21 | + |
| 22 | +// Get Token from Code |
| 23 | +POST https://rainerdemo.eu.auth0.com/oauth/token |
| 24 | +Content-Type: application/x-www-form-urlencoded |
| 25 | + |
| 26 | +client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&audience=http%3A%2F%2Foidc-webapi%2F&scope=openid%20offline_access%20read:data&code=X6A7HzN7aPKZPF-6&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&grant_type=authorization_code&client_secret=-oAiMEyVXlmW_jQ9YYLdJwRZt7gppB7DZapNT2BRzEfafAyJ5Z2Lug-DdDGdCx50 |
| 27 | + |
| 28 | +// Try access token in C# Web API |
| 29 | +GET http://localhost:5000/api/values |
| 30 | +Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik1FVTVSVGxGT1VRek5rUXhOVFE0T0RSRlFVWXpSVEE0TXpnMk9ETXhOalJDUkRoRlFrTTRNQSJ9.eyJpc3MiOiJodHRwczovL3JhaW5lcmRlbW8uZXUuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5NDYzNTFjOGMzNjZiMGQxODEzNGNkMiIsImF1ZCI6WyJodHRwOi8vb2lkYy13ZWJhcGkvIiwiaHR0cHM6Ly9yYWluZXJkZW1vLmV1LmF1dGgwLmNvbS91c2VyaW5mbyJdLCJhenAiOiJ3REVmczdxZUZ0QnhvN3BzU216cGVKN3FEdXRKWUk0QSIsImV4cCI6MTQ5Nzg2MzA3NCwiaWF0IjoxNDk3Nzc2Njc0LCJzY29wZSI6Im9wZW5pZCBvZmZsaW5lX2FjY2VzcyByZWFkOmRhdGEifQ.lS-wfMGaiSiAHC272mE8QBIfc_VArEvKJ8DKxzMM0m3H-M-Y_AByW3pJoj6Ow9rTGdLB28hKvpzydRgKRQ10u8FhV2-9MAKOCFibk4GvUzeIWCztc22SA82fW7KLH4dA0EC-zbAV_IdX-EXj6G8slPvWDrQKcyAGa2acmzOpeGYpDdHQAFur8oYcVEE4vpb04MeFFOdjcoWITJHnSvoEnZ6jjLn8wc38Ot8R09jqiNU8b4vmh2YXIij2lg6s6LEtcx1qRh18Q4U6Muezy9e1gSg8n1KVbswSlKeKOZfZLbhiWwMkaPfBEuMPrch02XIeGp8dlrKx4Hs8mxX619NNSQ |
| 31 | + |
| 32 | + |
| 33 | +// ===== IMPLICIT FLOW |
| 34 | +// Get Code with Scope |
| 35 | +GET https://rainerdemo.eu.auth0.com/authorize?client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&response_type=token&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&response_mode=fragment&audience=http%3A%2F%2Foidc-webapi%2F&scope=openid%20offline_access%20read:data&state=12345 |
| 36 | + |
| 37 | +// Try access token in Node.js Web API |
| 38 | +GET http://localhost:5001/api/values |
| 39 | +Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik1FVTVSVGxGT1VRek5rUXhOVFE0T0RSRlFVWXpSVEE0TXpnMk9ETXhOalJDUkRoRlFrTTRNQSJ9.eyJpc3MiOiJodHRwczovL3JhaW5lcmRlbW8uZXUuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5NDYzNTFjOGMzNjZiMGQxODEzNGNkMiIsImF1ZCI6WyJodHRwOi8vb2lkYy13ZWJhcGkvIiwiaHR0cHM6Ly9yYWluZXJkZW1vLmV1LmF1dGgwLmNvbS91c2VyaW5mbyJdLCJhenAiOiJ3REVmczdxZUZ0QnhvN3BzU216cGVKN3FEdXRKWUk0QSIsImV4cCI6MTQ5Nzc5NjU4NCwiaWF0IjoxNDk3Nzg5Mzg0LCJzY29wZSI6Im9wZW5pZCBvZmZsaW5lX2FjY2VzcyByZWFkOmRhdGEifQ.jGjUYRTlzo9bLgn4jdq4-QTkIa4Zb-Lhm7-d-b_11DmQl-nOJoUBZXmqHoGTtziIYp3UVwu_KB9TNuB1e8falanduOUlQlWqfwFxdsW4wDnOB_WII8XQZrHxBCa3TKODPjZ6ATUgp0m5vnK1KV9Ibk71Tjely8qLnLHcx3XOxyFq4GCXyJl0HFOzXgWMabUL1ujoen2gwEjzcxbUfkcUfAsQpyXsol7niZZcCh0czO3Q2X88pNuam0AERjpx3W005s5QrvzOKu0mqxA6OMEWY1eOLESVI1xI-lyfqmXYqcYwPV0X6z_CjYLOAsy586QYgjT88P8PoiWGL_1GgvTX-A |
| 40 | + |
| 41 | + |
| 42 | +// ===== HYBRID FLOW |
| 43 | +// Get Code with Scope |
| 44 | +GET https://rainerdemo.eu.auth0.com/authorize?client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&response_type=code%20id_token&redirect_uri=https%3A%2F%2Flocalhost:5000%2Flogin&response_mode=form_post&audience=http%3A%2F%2Foidc-webapi%2F&scope=openid%20email%20offline_access%20read:data&state=12345&nonce=67890 |
| 45 | + |
| 46 | + |
| 47 | +// ===== CLIENT CREDENTIALS |
| 48 | +// Get Tokens |
| 49 | +POST https://rainerdemo.eu.auth0.com/oauth/token |
| 50 | +Content-Type: application/x-www-form-urlencoded |
| 51 | + |
| 52 | +grant_type=client_credentials&audience=http%3A%2F%2Foidc-webapi%2F&client_id=wDEfs7qeFtBxo7psSmzpeJ7qDutJYI4A&client_secret=-oAiMEyVXlmW_jQ9YYLdJwRZt7gppB7DZapNT2BRzEfafAyJ5Z2Lug-DdDGdCx50 |
| 53 | + |
0 commit comments