Reader small image

You're reading from  Implementing Identity Management on AWS

Product typeBook
Published inOct 2021
PublisherPackt
ISBN-139781800562288
Edition1st Edition
Tools
Right arrow
Author (1)
Jon Lehtinen
Jon Lehtinen
author image
Jon Lehtinen

Jon Lehtinen has 16 years of enterprise identity and access management experience and specializes in both the strategy and execution of IAM transformation in global-scale organizations such as Thomson Reuters, General Electric, and Apollo Education Group. In addition to his work in the enterprise space, he has held positions on Ping Identity's Customer Advisory Board and as an advisor to identity verification start-up EvidentID. He currently owns the workforce and customer identity implementations at Okta. Jon is dedicated to the growth and maturity of IAM as a profession and serves on the Board of Directors for IDPro org. He is also a member of the Kantara Initiative, ISC2, OpenID Foundation, and Women in Identity. Jon has presented his work at several conferences, including RSA, Identiverse, and KuppingerCole's European Identity and Cloud Conference. Currently, he owns Okta's workforce and customer IAM implementations as their Director of Okta on Okta.
Read more about Jon Lehtinen

Right arrow

Chapter 12: AWS-Hosted Application Single Sign-On Using an Existing Identity Provider

In the previous chapter, we looked at several solution architectures for non-administrative identity use cases. We defined our non-administrative use case as wanting to expose our organization's identity information to applications hosted on Amazon Web Services (AWS), regardless of whether the account owner had access to the AWS backplane. Most organizations make a distinction between their administrative accounts and their standard user accounts, and often have distinct architectures for each of these use cases. Typically, standard application identity needs are satisfied through the use of standard user accounts. This chapter will focus on addressing the identity needs of AWS-hosted applications.

Whereas we can use native AWS services such as Amazon Cognito to solve application identity challenges on AWS, organizations often have policy or regulatory requirements that require them to demonstrate...

Technical requirements

To get the most out of this chapter, you will need the following:

  • An AWS account
  • A SAML2- and System for Cross-domain Identity Management (SCIM)-compliant IdP such as Okta Identity Cloud, PingOne, or Azure Active Directory (Azure AD)
  • A populated user directory to act as the user store for that IdP

Defining the use case and solution architecture

Before we begin connecting applications, user pools, and external IdPs, let's take a moment and visualize the solution we intend to build for the use case we want to solve. Once again, we have some familiar components in play for the Redbeard Identity organization, as shown in the following diagram:

Figure 12.1 – Application references Cognito, which looks to the external IdP

In this design, the application will look to an Amazon Cognito user pool for its user information. The user pool will act as the application's user store, and detailed attributes will be provided at authentication time through the Amazon Cognito identity token. Since Amazon Cognito user pools provide a standards-compliant OIDC IdP, additional attributes can be accessed through the /userinfo endpoint as needed, if the application is sufficiently entitled and scoped to have that access. In order to ensure that the Redbeard...

Creating a user pool

We will begin by creating a user pool that we intend to use for all of our users. This will be a repeat of the process we went through in Chapter 5, Introducing Amazon Cognito, so we will not be as fastidious in documenting the process, aside from the specifics of the configuration we require to fulfill our use case. Proceed as follows:

  1. From the AWS Management Console, go to Amazon Cognito and select the Manage User Pools option.
  2. Select Create a user pool. This takes us through to the wizard. We name our pool and select the option to step through the settings, to make the changes we will need to configure this user pool instance as we want. The process is illustrated in the following screenshot:

    Figure 12.2 – Creating a new user pool

  3. We will make several adjustments to the Attributes section. If we want our external IdP to be the authoritative source of user information for this user pool, we will need to ensure we include all of the attributes...

Connecting Amazon Cognito to an external IdP – SAML

Now that we have a user pool configured with attributes that match those found in our external IdP, we need to put some users inside it. We do not want users created directly inside the user pool as that would bypass the external IdP as the authoritative source of identity information for our users. To connect the external IdP with the user pool, we will need to configure our external IdP as an IdP for the user pool, as follows:

  1. From the user pool, we can select the type of federated provider we want to add under the Federation menu. We will select the SAML option, as illustrated in the following screenshot:

    Figure 12.7 – Selecting a new IdP for the user pool

  2. The configuration options are very sparse since it wants to import a metadata file. We will come back to the form shown in the following screenshot since we will need to build this connection on the external IdP side in order to create that metadata file...

Connecting Amazon Cognito to an external IdP – OIDC

Amazon Cognito user pools support the use of multiple external IdPs. It would be unusual, though not necessarily ill-advised, to connect the same external IdP to an Amazon Cognito user pool using both SAML and OIDC. We will connect our external IdP to OIDC in the interest of demonstrating how both protocols operate when used with an external IdP with a user pool. We'll proceed as follows:

  1. From the user pool, we can select the type of federated provider we want to add under the Federations menu. We will select the OpenID Connect option. We can see a marker on the SAML option indicating an existing connection, as illustrated in the following screenshot:

    Figure 12.21 – Selecting a new IdP for the user pool

  2. In the following screenshot, we see the required fields for configuring the new OIDC IdP. As we do not have all of these values yet, this means that we will need to create a client that the Amazon Cognito...

Assuming roles with identity pools

We have addressed our need for AWS-hosted apps to have baseline user authentication services available using Amazon Cognito user pools. This model allows us to continue to use our existing identity systems as the ultimate authoritative source for the users in those applications, even when those applications take advantage of services such as Amazon Cognito for their identity use cases. For applications with architectures that have deep integration into AWS services, Amazon Cognito identity pools can provide authorization to AWS resources such as Amazon Simple Storage Service (S3) buckets and Amazon Relational Database Service (RDS) databases. This allows the application users to indirectly interact with these services when using the application that is built to leverage them.

Let's consider a use case where the Redbeard Identity Sales team manages its sales reports through an application that is hosted on AWS. The reports are published to...

Summary

In this chapter, we explored the authentication and authorization options available to applications hosted in AWS. We were able to provide identity information to those applications leveraging AWS identity services, particularly Amazon Cognito, while continuing to respect our organization's existing IAM infrastructure as the authoritative source for access control. We showed how to delegate authentication to an external provider using both SAML and OIDC when using an Amazon Cognito identity pool, and then explored how we could apply authorization controls to an AWS-hosted application by assigning distinct AWS IAM roles to Amazon Cognito identities based upon claims from that external IdP.

And with that, we have reached the end of the book. Congratulations on making it through! You now have a solid foundation of AWS identity knowledge that will make you better prepared to address your cloud identity challenges moving forward.

Questions

  1. Why would an organization choose to federate their managed identities into an Amazon Cognito user pool for application identity?

    a. Allows the app team to use native AWS services for identity.

    b. Allows the organization to continue to enforce their compliance controls centrally, even though applications may not look directly to their identity systems for user information.

    c. They shouldn't; they should only connect apps directly to their organization's official IdP.

    d. A and B.

  2. Why would we apply a trust policy that validates a principal was authenticated by the identity pool that is requesting temporary credentials for an Amazon Cognito user?

    Otherwise, non-authenticated users could be granted access to AWS resources within the account.

Further reading

Here are some resources for making applications SAML2- and OIDC-compliant through relying parties:

Why subscribe?

  • Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
  • Improve your learning with Skill Plans built especially for you
  • Get a free eBook or video every month
  • Fully searchable for easy access to vital information
  • Copy and paste, print, and bookmark content

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Implementing Identity Management on AWS
Published in: Oct 2021Publisher: PacktISBN-13: 9781800562288
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Jon Lehtinen

Jon Lehtinen has 16 years of enterprise identity and access management experience and specializes in both the strategy and execution of IAM transformation in global-scale organizations such as Thomson Reuters, General Electric, and Apollo Education Group. In addition to his work in the enterprise space, he has held positions on Ping Identity's Customer Advisory Board and as an advisor to identity verification start-up EvidentID. He currently owns the workforce and customer identity implementations at Okta. Jon is dedicated to the growth and maturity of IAM as a profession and serves on the Board of Directors for IDPro org. He is also a member of the Kantara Initiative, ISC2, OpenID Foundation, and Women in Identity. Jon has presented his work at several conferences, including RSA, Identiverse, and KuppingerCole's European Identity and Cloud Conference. Currently, he owns Okta's workforce and customer IAM implementations as their Director of Okta on Okta.
Read more about Jon Lehtinen