Ernesto Rodriguez
Ernesto Rodriguez

Reputation: 267

Microsoft Graph and redirect_uri http instead of https

I trying to authenticate with Microsoft Graph 2 using ASP.Net Core (MVC).

The AzureAd settings:

"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"TenantId": "common",
"CallbackPath": "/signin-oidc"  }

The site url is like

https://mysite

Then I was redirected to the login url:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?...

but the redirect_uri, in the url parameters, does not include the https

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=****&redirect_uri=http%3A%2F%2Fmysite%2Fsignin-oidc

I was trying to force the using of HTTPS but I can´t find it

Upate:

The application is deployed in Linux.

Any suggestion?

Upvotes: 0

Views: 838

Answers (1)

Ernesto Rodriguez
Ernesto Rodriguez

Reputation: 267

Adding in dockerfile:

ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true

it works for me like comment Anand´s link

Upvotes: 1

Related Questions