OpenID Connect describes a metadata document that contains most of the information required for an app to do sign-in. This includes information such as the authorization endpoint, token endpoint, tenant region scope, etc. For the discovery endpoint, this is the OpenID Connect metadata document you should use:

https://login.windows.net/{domain}/.well-known/openid-configuration

The {domain} can take one of two values:

Value

Description

common

Users with both a personal Microsoft account and a work or school account from Azure AD can sign in to the application.

contoso.com

The friendly domain name of the Office 365 tenant

The metadata is a simple JSON. See the following snippet for an example.

screen-shot-2019-09-23-at-8.09.36-pm

To get the tenant ID, we just need to parse the token_endpoint property as shown below:

screen-shot-2019-09-23-at-8.17.19-pm

We will get the following JSON for the invalid domain name.

screen-shot-2019-09-23-at-8.10.03-pm

Sample PowerApps using the above mentioned endpoint

Video Demo Watch the video

Hope this helps. Sharing is Caring !