Skip to content

Commit 45753b5

Browse files
authored
Update how-to-generate-auth-token.md
1 parent 76427b3 commit 45753b5

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

articles/energy-data-services/how-to-generate-auth-token.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,13 @@ Generating a user's auth token is a two-step process.
132132
The first step to get an access token for many OpenID Connect (OIDC) and OAuth 2.0 flows is to redirect the user to the Microsoft identity platform `/authorize` endpoint. Microsoft Entra ID signs the user in and requests their consent for the permissions your app requests. In the authorization code grant flow, after consent is obtained, Microsoft Entra ID returns an authorization code to your app that it can redeem at the Microsoft identity platform `/token` endpoint for an access token.
133133

134134
1. Prepare the request format using the parameters.
135-
#### Request format
136-
137-
```bash
138-
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize?client_id=<client-id>
139-
&response_type=code
140-
&redirect_uri=<redirect-uri>
141-
&response_mode=query
142-
&scope=<client-id>%2f.default&state=12345&sso_reload=true
143-
```
135+
```bash
136+
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize?client_id=<client-id>
137+
&response_type=code
138+
&redirect_uri=<redirect-uri>
139+
&response_mode=query
140+
&scope=<client-id>%2f.default&state=12345&sso_reload=true
141+
```
144142
2. After you replace the parameters, you can paste the request in the URL of any browser and select Enter.
145143
3. Sign in to your Azure portal if you aren't signed in already.
146144
4. You might see the "Hmmm...can't reach this page" error message in the browser. You can ignore it.
@@ -149,12 +147,9 @@ The first step to get an access token for many OpenID Connect (OIDC) and OAuth 2
149147

150148
5. The browser redirects to `http://localhost:8080/?code={authorization code}&state=...` upon successful authentication.
151149
6. Copy the response from the URL bar of the browser and fetch the text between `code=` and `&state`.
152-
153-
#### Sample response
154-
155-
```bash
156-
http://localhost:8080/?code=0.BRoAv4j5cvGGr0...au78f&state=12345&session....
157-
```
150+
```bash
151+
http://localhost:8080/?code=0.BRoAv4j5cvGGr0...au78f&state=12345&session....
152+
```
158153

159154
7. Keep this `authorization-code` handy for future use.
160155

0 commit comments

Comments
 (0)