This is a guide to set up SAML 2.0 for AWS with Azure Active Directory. All steps listed on this page are required for account set up and having a successful ODBC connection.
- Prerequisites
- Setting up Azure AD
- Setting up the IAM provider and roles
- Timestream ODBC DSN Configuration
- Troubleshooting Guide
-
Admin permissions in AWS to create the identity provider and the roles.
-
An Azure Active Directory account: https://azure.microsoft.com/en-ca/services/active-directory/
-
Access to Timestream.
-
Sign in to Azure Portal.
-
Select
Azure Active Directory
in the list of Azure services, this will redirect to theDefault Directory
page. -
Select
Enterprise Applications
under theManage
section on the sidebar: -
Select
+ New application
-
Find and select
AWS Single-Account Access
, clickCreate
. -
Select
Single sign-on
underManage
section in the sidebar: -
Choose SAML as the single sign-on method.
-
In the
Basic SAML Configuration
, enterhttps://signin.aws.amazon.com/saml
for both theIdentifier
and theReply URL
: -
Click
Save
. -
Download the
Federation Metadata XML
in theSAML Signing Certificate
section. This will be used when creating the IAM Identity Provider later.- If the Download link is greyed out, try refreshing the page.
-
Go back to the
Default Directory
page, selectApp registrations
underManage
. -
Select
AWS Single-Account Access
that you created in step 5 from theAll Applications
section, the page will be redirected to the application’sOverview
page. -
Take notes of the
Application (client) ID
and theDirectory (tenant) ID
, these values are required for when creating a connection: -
Select
Certificates & secrets
-
Under
Client secrets
, create a new client secret with+ New client secret
. Take note of the generated value, this is required when creating a connection to Timestream. -
On the sidebar under
Manage
, selectAPI permissions
. -
In the
Configured permissions
, useAdd a permission
to grant Azure AD permission to sign in to Timestream. SelectMicrosoft Graph
on theRequest API permissions
page. -
Select
Delegated permissions
, select theUser.Read
permission.- Click
Add permissions
.
- Click
-
Click
Grant admin consent for Default Directory
.
Azure AD set up process is now complete.
This set up will guide you through the following:
-
Creating the SAML identity provider.
-
Creating an IAM role for access to Timestream.
-
Creating an IAM policy allowing the IAM role to generate an AWS STS token to connect to Timestream.
-
Sign in to the AWS Management Console.
-
Select Services and select IAM under Security, Identity, & Compliance.
-
Select Identity providers under Access management.
-
Select
Add Provider
and chooseSAML
as the provider type. Enter the Provider Name, this example will use AzureADProvider. -
Upload the previously downloaded Federation Metadata XML file.
-
Select
Add provider
.
Upon completion, the page will be redirected back to the Identity providers
page.
Pre-requisite: be on the page for IAM
(follow steps 1-2 under "Create a SAML Identity Provider")
-
On the sidebar select
Roles
underAccess management
. -
Select
Create role
. -
Choose
SAML 2.0 federation
as the trusted entity. -
Choose the Azure AD provider.
-
Select
Allow programmatic and AWS Management Console access
. -
Click
Next
to set up permissions. -
Attach permissions policies or continue to
Next:Tags
. The role needs to have Timestream full access permission to access Timestream databases. -
Add optional tags or continue to
Next:Review
. -
Enter a
Role name
, this example will useAzureSAMLRole
. -
Provide a role description.
-
Click
Create Role
to complete.
Pre-requisite: be on the page for IAM
(follow steps 1-2 under "Create a SAML Identity Provider")
-
On the sidebar select
Policies
underAccess management
. -
Select
Create policy
and select theJSON
tab. -
Add the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"iam:ListAccountAliases"
],
"Resource": "*"
}
]
}
-
Click
Next: Tags
. Add tags if needed. -
Click
Next: Review
. Enter a policy name, this example will useTimestreamAccessPolicy
. -
Click
Create Policy
. -
On the sidebar select
Roles
underAccess management
. Select the previously created Azure AD role, selectAttach policies
underPermissions
. -
Select the previously created access policy.
-
Go back to Azure Portal.
-
Select
Azure Active Directory
in the list of Azure services, this will redirect to theDefault Directory
page. -
Select
Enterprise Applications
under theManage
section on the sidebar. -
Select
AWS Single-Account Access
from the list. -
Select
Provisioning
on the sidebar. -
Click
Get started
and selectAutomatic mode
for theProvisioning Method
. -
Under
Admin Credentials
, enterAwsAccessKeyID
forclientsecret
field, andSecretAccessKey
forSecret Token
field. -
Click on
Test Connection
button to test the connection, ensure that the test passes before proceeding further. If testing fails, check that the AWS Access credentials that you entered is correct. -
Make sure
Provisioning Status
is set toon
. ClickSave
and go back toProvisioning
home page. -
Click
Start provisioning
. This allows Azure AD to load the necessary IAM Roles. You may need to refresh the page. Continue after the initial cycle is completed. -
Once the
Current cycle status
is completed, go back toAWS Single-Account Access
overview, and selectUsers and groups
on the sidebar. -
Select
+ Add user/group
. -
Select the Azure AD user to provide access to Timestream.
-
Select the IAM Azure AD role and the corresponding Azure Identity Provider created in AWS.
- If you are not able to select roles here or if the IAM Azure AD roles are missing, it’s likely because the initial cycle is not run for provisioning, make sure you finish step 10 and try again.
-
Click
Assign
. Now you can proceed to login with credentials using the ODBC driver. -
(Optional) Verify the Single-Sign-On (SSO) could work from Azure AD.
i. Go back to
AWS Single-Account Access
overview, and selectSingle sign-on
on the sidebar.ii. Scroll down the page to find "Test single sign-on with AWS Single-Account Access" section and click
Test.
iii. On the popped-up section, ensure
Sign in as current user
is selected. ClickTest sign in
. Then user should see that they have successfully signed-in to AWS Console Home with the linked AWS account.
Connection properties for Azure AD
Option | Description | How to find the value |
---|---|---|
UID or IdPUserName |
The user name for the specified IdP account. | Use the username/email of the account that is used to log in to Microsoft Azure. |
PWD or IdPPassword |
The password for the specified IdP account. | Use the password of the account that is used to log in to Microsoft Azure. |
AADApplicationID |
The unique id of the registered application on Azure AD. | Use Application ID in step 13 under setting up AzureAD |
AADClientSecret |
The client secret associated with the registered application on Azure AD used to authorize fetching tokens. | Use generated secret value from step 15 under setting up AzureAD |
AADTenant |
The Azure AD Tenant ID. | Use Directory (tenant) ID in step 13 under setting up AzureAD |
RoleARN |
The Amazon Resource Name (ARN) of the role that the caller is assuming. | The ARN value from the IAM role that is created in Create am IAM role and used in step 14 of Provisioning |
IdPARN |
The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP. | The ARN value from the identity provider that is created in Creating the SAML identity provider and used in step 14 of Provisioning |
-
Cannot sign in using Single-Sign-On (SSO) from Azure AD using user with email that includes
#EXT#<directory_name>.onmicrosoft.com
. E.g.,Jane.Doe_gmail.com#EXT#@defaultdirectory.onmicrosoft.com
would be a generated user email from original email[email protected]
.Try using the original email of your Microsoft Azure AD instead.
-
Able to sign in using Single-Sign-On (SSO) from Azure AD, but unable to sign in using Timestream ODBC Driver.
Double check that the Azure AD (AAD) credentials are entered correctly in the DSN. If all credentials are correct, note that it may take some time for Azure AD account to properly work after set up. Try sign in again in 1 hour after the Azure AD account set up is complete.
-
Error
Request to Azure Active Directory for access token failed
is seen when connect to Timestream.Try to create a test user and assign IAM Identity Provider and Roles to the user. Use the test user to connect to Timestream.
To verify the test user could work, follow the steps below.
-
In the Azure portal, select
Enterprise Applications
, and then selectAll applications
. -
In the applications list, select
AWS Single-Account Access
. -
In the app's overview page, find the
Manage
section and selectSingle sign-on
. -
Scroll down and click
Test
under sectionTest single sign-on with AWS Single-Account Access
. -
Select
Sign in as someone else
(requires browser extension) and sign-in with A.Elena’s credentials.a. Download the browser extension that is needed to enable
Sign in as someone else
function.c. When signing in the user for the first time, Microsoft will ask you to reset the password. Reset the password as asked.
-
After sign-in succeed, you can use the test user’s credentials for testing.
-