-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from madmatt/pulls/add-azure-ad
Add Azure AD capability to module
- Loading branch information
Showing
10 changed files
with
331 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
|
||
- [Azure AD administrator guide](#azure-ad-administrator-guide) | ||
- [Table of contents](#table-of-contents) | ||
- [Overview](#overview) | ||
- [Creating a new Enterprise Application](#creating-a-new-enterprise-application) | ||
- [FAQs](#faqs) | ||
- [Why do we require using `objectId` instead of `userprincipalname`?](#why-do-we-require-using-objectid-instead-of-userprincipalname) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# Azure AD administrator guide | ||
|
||
This guide will step you through configuring a new SAML integration in Azure AD, such that Azure AD can act as an Identity Provider (IdP) for a SilverStripe site. | ||
|
||
## Table of contents | ||
|
||
## Overview | ||
|
||
This is not an exhaustive guide, and it only covers Azure AD. Other SAML IdPs should have similar configuration, and the module should be able to work with them provided they can give the same guarantees about the attributes being passed through in the SAML assertion. | ||
|
||
As an implementor of the IdP, you need to ensure the following have been set up: | ||
|
||
* A bi-directional trust between SP and IdP (via metadata files) | ||
* Ensuring that `user.objectId` is used as the User Identifier (aka SAML Name ID) rather than `user.userprincipalname` | ||
|
||
## Creating a new Enterprise Application | ||
|
||
1. Log in as an Azure portal administrator. | ||
2. In the Azure portal, go to the ['Azure Active Directory' service](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview) | ||
3. Click on 'Enterprise Applications', then 'New application' | ||
4. Select 'Non-gallery application' and enter a descriptive name (e.g. 'Intranet'), then click Add | ||
5. Once the application is created, select 'Single sign-on' from the left-menu, then select 'SAML' | ||
6. Either upload the metadata file provided by the site developers, or enter the Entity ID and Reply URLs provided by the developers. These should always have the same base hostname, with the Reply URL including '/saml/acs' at the end | ||
7. Under 'User Attributes', select `user.objectId` as the User Identifier, instead of the default (`user.userprincipalname`) | ||
8. Provide the 'App Federation Metadata Url' and the base64 copy of the certificate under section 4 to the site developers | ||
|
||
Once the site developers have deployed the certificates and login URLs, the configuration should be set up and ready to be tested. You will need to configure users or groups that have access to this application before Azure AD will pass them through to the website, you can do this from the 'Users and groups' sidebar menu. | ||
|
||
## FAQs | ||
|
||
### Why do we require using `objectId` instead of `userprincipalname`? | ||
|
||
This is because `user.userprincipalname` (UPN) is not guaranteed to be unique *forever*, it is only guaranteed to be unique for the lifetime of a user's account. This is problematic in some situations. For example: | ||
|
||
1. John Smith joins the organisation, and given a UPN of john.smith@contoso.com | ||
2. John Smith is added to the list of users that can access the website, and is given special administrator privileges over the website | ||
3. John then leaves the organisation and his account is deleted. The website is not aware that John has been deleted because SAML provides no mechanism for this, so the website still has an administrator account configured for John, but nobody can login to it right now. | ||
4. A different John Smith starts at the organisation in a different role (e.g. not an administrator). They are given access to the website, and when they login they see they have administrative privileges. | ||
|
||
This is because the UPN is only unique at any given time, not forever. To ensure that we don't run into security issues with the above, we require that Azure AD integrations use the `objectId` of the user instead. This means that the second John Smith in the above example will have a new account created for him, as his `objectId` will not match the `objectId` of the former John Smith. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Contribution guidelines | ||
This document describes additional contribution guidelines that apply to this module only. | ||
|
||
## Table of Contents | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
|
||
- [Documentation](#documentation) | ||
- [Adding new functionality](#adding-new-functionality) | ||
- [Adding support for new identity providers (IdPs)](#adding-support-for-new-identity-providers-idps) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Documentation | ||
All changes should be documented to a similar (or better) level as the existing code. | ||
|
||
If you add or change headings in any of the existing documentation files, or create a new markdown file, make sure you re-run `./build-toc`: | ||
|
||
- `npm install -g doctoc` | ||
- `cd /path/to/module/docs/en` | ||
- `./build-toc` | ||
|
||
If the above doesn't work because build-toc fails or similar, feel free to submit your PR without updating the table of contents and we can do this upon merge. | ||
|
||
## Adding new functionality | ||
This module follows semantic versioning, therefore id you change anything that breaks backwards compatibility that will require a new major release. Please be clear about this when creating new pull requests. Alternatively, you can get you feature merged faster if you include YML configuration to disable your feature, and make it optional to enable. | ||
|
||
If you add additional functionality, make sure to document it both in the codebase as well as the appropriate file in the docs directory. | ||
|
||
## Adding support for new identity providers (IdPs) | ||
Adding support for new IdPs generally means you also need to add documentation that describes how that IdP should be configured to work with this module. | ||
|
||
For an example of the level of detail to include, see the existing documentation for [Azure AD](azure-ad.md) and [ADFS](adfs.md). Generally, this should describe at a high level exactly what you expect from the administrator of the IdP, and should be a document that you are comfortable sending to your IdP sysadmin to implement. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.