Skip to content

Commit

Permalink
Update documentation for Azure AD B2C (#145)
Browse files Browse the repository at this point in the history
* Updates to match proposed changes to social-core

* Fix spacing
  • Loading branch information
zchoate committed Mar 30, 2023
1 parent ce00223 commit dc7a878
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docs/backends/azuread.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ To enable OAuth2 B2C Tenant support:
- Fill in ``Client ID`` and ``Client Secret`` settings. These values can be
obtained easily as described in `Azure AD Application Registration`_ doc::

SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_KEY = ''
SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_SECRET = ''
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_KEY = ''
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_SECRET = ''

- Fill in the tenant id::

SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_TENANT_ID = ''
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_TENANT_NAME = ''

- Fill in the B2C policy::

Expand All @@ -106,29 +106,28 @@ The policy should start with `b2c_`. For more information see `Azure AD B2C User

- Also it's possible to define extra permissions with::

SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_RESOURCE = ''
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_RESOURCE = ''

This is the resource you would like to access after authentication succeeds.
Some of the possible values are: ``https://graph.windows.net`` or
``https://<your Sharepoint site name>-my.sharepoint.com``.

When using Microsoft Graph, the resource needed is::

SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_RESOURCE = 'https://graph.microsoft.com/'
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_RESOURCE = 'https://graph.microsoft.com/'

- Add the backend to the authentication backends setting::

AUTHENTICATION_BACKENDS = (
...
'social_core.backends.azuread_tenant.AzureADB2COAuth2',
'social_core.backends.azuread_b2c.AzureADB2COAuth2',
...
)

- If you are using an authority host other than the default ``AZURE_PUBLIC_CLOUD`` ('login.microsoftonline.com')
then you can override the default with the ``AUTHORITY_HOST`` setting. The Azure authority hosts are listed
in the `Azure Authority Hosts`_ doc::
- If you are using an authority host other than the default ``AZURE_PUBLIC_CLOUD`` ('b2clogin.com')
then you can override the default with the ``AUTHORITY_HOST`` setting.

SOCIAL_AUTH_AZUREAD_B2C_TENANT_OAUTH2_AUTHORITY_HOST = ''
SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_AUTHORITY_HOST = ''

.. _Azure AD Application Registration: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app
.. _Azure AD B2C User flows and custom policies overview: https://docs.microsoft.com/en-us/azure/active-directory-b2c/user-flow-overview
Expand Down

0 comments on commit dc7a878

Please sign in to comment.