Azure active directory oauth error

I´m trying to login into my Grafana v5.2.3 with a Oauth2 login in Azure Active Directory. I read the grafana documentation with the steps but when i finished i have this error:
image

Grafana is hosted in a virtual machine on azure running with linux.

When I check the grafana log:
t=2018-09-21T14:44:16+0000 lvl=eror msg=login.OAuthLogin(NewTransportWithCode) logger=context userId=0 orgId=0 uname= error=“oauth2: cannot fetch token: 400 Bad Request\nResponse: {"error":"invalid_resource","error_description":"AADSTS50001: Resource identifier is not provided.\r\nTrace ID: 1743d4f7-9435-42ad-85f5-1579014f2a00\r\nCorrelation ID: 721f9842-b3f5-4cee-989b-d560f5fed47a\r\nTimestamp: 2018-09-21 14:44:16Z","error_codes":[50001],"timestamp":"2018-09-21 14:44:16Z","trace_id":"1743d4f7-9435-42ad-85f5-1579014f2a00","correlation_id":"721f9842-b3f5-4cee-989b-d560f5fed47a"}”

My config is:

#################################### Server ####################################
[server]
# Protocol (http or https)
protocol = https

# The ip address to bind to, empty will bind to all interfaces
http_addr = 0.0.0.0

# The http port  to use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = mydomain.com

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = %(protocol)s://%(domain)s:%(http_port)s/

# Log web requests
;router_logging = false

# the path relative working path
;static_root_path = public

# enable gzip
;enable_gzip = false

Any idea of what I’m doing wrong?

That error indicates that there is either a problem with your session store, or that the url you’re using to access the initial login page does not match the configured root_url (so your session cookie is not valid when you get redirected back to the canonical Grafana url).

Thanks for the reply. I found one mismatch in the domain name. Now the error is:

image

In the grafana log i have the same problem “cannot fetch token: 400 Bad Request\nResponse: {"error":"invalid_resource","error_description":"AADSTS50001: Resource identifier is not provided.”

Anyone have an idea?