0
votes

Is it possible to write java code which will go to login.microsoftonline.com to obtain authorization code and store it in String variable without any redirection ?

https://login.microsoftonline.com/{tenant}/oauth2/authorize? client_id=6731de76-14a6-49ae-97bc-6eba6914391e &response_type=code &redirect_uri=http%3A%2F%2Flocalhost%3A%12345 &response_mode=query &resource=https%3A%2F%2Fservice.contoso.com%2F &state=12345

Best Regards

1
no. Authorization Code imposes user interaction.astaykov

1 Answers

0
votes

No. Because authorization code can only be obtained via user interaction. You may want to read the Authorization Code Grant Flow in Azure AD to fully understand this flow.

Further more, the Authentication Basics is really good starting resource.