Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDPT-1896 Change the local and dev Entra apps to the Entra dev environment. #713

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ To verify that S3 & CloudFront are working correctly.
### Useful links

- [Ministry of Justice | Overview](https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/Overview)
- App [justicedigital-centraldigital-intranet-local](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/appId/73ed65a5-e879-4027-beab-f5e64de803b7/isMSAApp~/false)
- App [justicedigital-centraldigital-intranet-development](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/quickStartType~/null/sourceType/Microsoft_AAD_IAM/appId/1dac3cbf-91d2-4c0e-9c80-0bf3f8fabd75)
- App [justicedigital-centraldigital-intranet-staging](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/quickStartType~/null/sourceType/Microsoft_AAD_IAM/appId/ffb808d2-312b-4ffe-a6e5-d6eacfd9f06f)
- App [justicedigital-centraldigital-intranet](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/quickStartType~/null/sourceType/Microsoft_AAD_IAM/appId/f508fd07-8504-47ed-a7d1-aa55fd2163d1)

Expand All @@ -333,15 +331,15 @@ To verify that S3 & CloudFront are working correctly.
3. Click on `App registrations`.
4. Click on `New registration`.
5. Fill in the form (adjust to the environment):
- Name: `justicedigital-centraldigital-intranet-development`
- Name: `justicedigital-centraldigital-intranet-staging`
- Supported account types: `Accounts in this organizational directory only`
- Redirect URI: `Web` and `http://localhost/oauth2?action=callback`
or `https://dev.intranet.justice.gov.uk/oauth2?action=callback` etc.
- Redirect URI: `Web` and `https://staging.intranet.justice.gov.uk/oauth2/callback`
or `https://intranet.justice.gov.uk/oauth2/callback` etc.
6. Copy the `Application (client) ID` and `Directory (tenant) ID` values,
make them available as environment variables `OAUTH_CLIENT_ID`, `OAUTH_TENANT_ID`.
7. Click on `Certificates & secrets` > `New client secret`.
8. Fill in the form:
- Description: `Local-Intranet-v2`
- Description: `Staging-Intranet-v2`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 😄
A quick Q... why are we using v2, do we know what does it means?
... maybe we can drop the v all together?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it was to differentiate between Tactical Product's secrets, but I think it's unnecessary - I'll remove.

- Expires: `18 months`
9. Set a reminder to update the client secret before it expires.
10. Copy the `Value` value, make it available as environment variable `OAUTH_CLIENT_SECRET`.
Expand All @@ -350,6 +348,15 @@ To verify that S3 & CloudFront are working correctly.
The oauth2 flow should now work with the Azure AD/Entra ID application.
You can get an Access Token, Refresh Token and an expiry of the token.

### Development Tenant

The App for localhost and dev.intranet.justice.gov.uk is managed by the Identity Team.

The App is on the development tenant, any you'll need to use a development email address for access.

The `OAUTH_*` values are stored in a shared note in 1password.
They can be copied to `.env` to use oauth locally.

## Access control

To view the intranet content, visitors must meet one of the following criteria.
Expand Down
4 changes: 2 additions & 2 deletions deploy/development/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ data:
WP_SITEURL: 'https://dev.intranet.justice.gov.uk/wp'
AWS_CLOUDFRONT_HOST: 'cdn.dev.intranet.justice.gov.uk'
# See Azure Setup for more information on how to get these values.
OAUTH_CLIENT_ID: "1dac3cbf-91d2-4c0e-9c80-0bf3f8fabd75"
OAUTH_TENANT_ID: "c6874728-71e6-41fe-a9e1-2e8c36776ad8"
OAUTH_CLIENT_ID: "51266573-d4eb-41db-8ebe-a9548aa4f01e"
OAUTH_TENANT_ID: "0bb413d7-160d-4839-868a-f3d46537f6af"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These might (will) get flagged by the security squad at some point. Do they need to be hidden or are we good to roll with them?

Copy link
Contributor Author

@EarthlingDavey EarthlingDavey Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, I'll add a concise note as to why these are ok here.

Loading