microsoft
id: api/oauth/microsoft title: Microsoft OAuth​
GET /api/oauth/microsoft
​
Initiate Microsoft OAuth2 login/link flow. Redirects the user to Microsoft's consent page.
- Authentication: Requires the user to be authenticated (session cookie / JWT) to link the provider to the current account.
- Optional
redirect_to
query param will be encoded intostate
and restored after callback.
Response​
- 302 Found (Redirect) — Redirects to Microsoft's auth URL.
Example​
curl -i -X GET "http://localhost:8080/api/oauth/microsoft?redirect_to=/calendar" \
--cookie "token=your_jwt_token"
GET /api/oauth/microsoft/callback
​
Microsoft calls this callback after user consent. Successful authentication redirects back to the restored redirect_to
or /
. Failure redirects to /login
.
Response​
- 302 Found (Redirect) — Success -> restored
redirect_to
(or/
); Failure ->/login
.
Notes​
- The server requests scopes including
user.read
,openid
,profile
,email
, and optionaloffline_access
for refresh tokens.