SlideShare a Scribd company logo
Complex architectures for
authentication and authorization
on AWS
Boyan Dimitrov
Director Platform Engineering @ Sixt @nathariel
September 2019
Our Focus Today
Service
?
Authenticate
& Authorize
• Key patterns for authentication
and authorization
- Client to service
- Service to service
- Service to Infra
• Focusing on the application and
more complex microservices
environments
Our Focus Today
Service
?
Authenticate
& Authorize
Service
Service
Autenticate
& Authorize
Service
Service
Service
IdP
Autenticate
& Authorize
Before we begin: The Foundations
OIDC ( OpenID Connect ) - a protocol
for Authentication built on top of
OAuth 2.0
OAUTH 2.0 –
a protocol for Authorization
Before we begin: AWS Cognito
AWS Cognito
User Pools
AWS Cognito
Federated Identities
Identity providers
Social Identity Providers
Other Identity Providers
SAML
OIDC
S3
EC2
Federate
AuthorizeFederate
Tip #1
If you are starting a new project on AWS involving
auth and you need IdP, Use Cognito
Client to service auth
Auth primer
Mobile
Client
Amazon API Gateway
Custom Authorizer
Amazon Cognito
1. Authenticate via
credentials
Service
2. Receive JWT
3. Invoke API with JWT
4. Validate JWT
6a. Check token scope
5. Return validity
6b. Invoke custom auth
function
Auth Service
7. Forward request
We live in a complex world…
Amazon API Gateway
Amazon Cognito
Service
Service
Service
Service
Service
Service Service
Service
Service
On-Prem
auth
auth
auth
auth
auth
auth
auth
Elastic Load Balancer
• I already have a / multiple IdPs, how to integrate all of that ?
• Where do we do authentication & token validation in a heterogeneous
environment with various ingress points ?
• How do we do authorization and on what level ?
• What about service to service auth?
• What about infrastructure auth ?
Auth challenges in complex architectures
Tip #2
Consider IdP Federation to simplify your problem
Authentication: Common Identity Format
Amazon Cognito
Internal Perimeter
SAML
OIDC
federate
Standard
Access Token
External Perimeter
Service Service Service Service
Authenticate
Define your authorization strategy
ACL MAC DAC RBAC ADAC PBAC …
Tip #3
If Authorization requirements are unclear, start
with RBAC and complicate as needed
ACL MAC DAC RBAC ADAC PBAC …
RBAC Authorization
Primer
Service Service Service Service
Amazon Cognito
Internal Perimeter
SAML
OIDC
External Perimeter
{
"name": "John Doe",
"email": "john.doe@foo.com",
"roles": ["finance_controller"]
…
}
If role ==„finance_controller“...
X
Amazon API Gateway
Tip #4
Do not embed volatile business roles into your
applications – implement access controls around
service capabilities instead
Delegate auth to a central auth service
User Service
POST /users
GET /users/<id>
PUT /users/<id>
DELETE /users/<id>
API Contract
Associated Permissions
users:create:any
users:read:any
users:read:own
users:update:any
users:update:own
users:delete:own
users:delete:any
{
"name": "John Doe",
"email": "john.doe @foo.com",
"roles": ["finance_controller"],
“user_id": 343242,
…
}
Auth
Service
GET /users/343242
finance_controller -> users:read:own
Role Permission
Authorised?
Centralised Auth Service
User Service
Auth
Service
Advantages
• Externalised auth decisions and
business roles management
• Easier to manage and change
• Single source of truth
Disadvantages
• Another synchronous dependency
• Additional latency
• Single point of failure?
• Manual effort in keeping permissions up to date
Centralised Auth Service Optimisations: automate permission
discovery
User ServiceAuth
Service
Associated Permissions
users:create:any
users:read:any
users:read:own
users:update:any
users:update:own
users:delete:own
users:delete:any
Register permissions on startup
Service:Permissions Map
com.x.service.user users:create:any
com.x.service.user users:read:any
com.x.service.user users:read:own
com.x.service.user users:update:any
com.x.service.user users:update:own
com.x.service.user users:delete:own
com.x.service.user users:delete:any
Centralised Auth Service Optimisations: caching associated roles
Associated Permissions
users:create:any
users:read:any
users:read:own
users:update:any
users:update:own
users:delete:own
users:delete:any
User ServiceAuth
Service
finance_controller -> com.x.service.user users:read:own
Role Permission
Centralised Auth Service Optimisations: caching associated roles
Associated Permissions and Roles
users:create:any
users:read:any
finance_controller -> users:read:own
users:update:any
users:update:all
users:delete:own
users:delete:any
finance_controller ALLOW com.x.service.user users:read:own
Role Permission
1. On Startup user service caches relevant
roles for its permissions
2. Receive live updates during runtime
User ServiceAuth
Service
Centralised Auth Service Optimisations: caching auth result
User Service
Auth
Service
Associated Permissions
users:create:any
users:read:any
users:read:own
users:update:any
users:update:all
users:delete:own
users:delete:any
{
"name": "John Doe",
"email": "john.doe @foo.com",
"roles": ["finance_controller"],
“user_id": 343242,
“jti“: 21312e1d123
…
}
User Service
Auth
Service
1. Authorize operation
2. Cache authorization response
with TTL
Permissions and Cached Policy Result
users:create:any
users:read:any
21312e1d123 -> users:read:own
users:update:any
users:update:all
users:delete:own
users:delete:any
{
"name": "John Doe",
"email": "john.doe @foo.com",
"roles": ["finance_controller"],
“user_id": 343242,
“jti“: 21312e1d123
…
}
Centralised Auth Service Optimisations: caching auth result
Bonus: Local token validation
User Service
Cache the access token JWK
for local validation
Amazon Cognito
{
"name": "John Doe",
"email": "john.doe @foo.com",
"roles": ["finance_controller"],
…
“kid": "5689example"
}
{
“keys": [{
“kid": "5689example",
“alg": "RS256"
}, {
…
}]}
Authorization
Service Service Service Service
Amazon Cognito
Internal Perimeter
SAML
OIDC
External Perimeter
Auth Service
“Decentralised“ authorisation
Centralised Auth Service
User Service
Auth
Service
Advantages
• Externalised auth decisions and
business roles management
• Easier to manage and change
• Single source of truth
• Decentralised token validation and auth
Disadvantages
• Another synchronous dependency
• Additional latency
• Single point of failure?
• Manual effort in keeping permissions up to date
DEMO
Demo Architecture
Auth Service Hello World Service
Amazon Cognito
User Pool
Register a user & Authenticate
Authorize hello request
• Automated permission registration
• Auth rules caching
• Decentralised authorization
• Local token validation
Fetch IdP JWK
Demo WebappAdmin Webapp
Manage Permissions
So far we covered…
Service
?
Authenticate
& Authorize
Service
Service
Autenticate
& Authorize
Service
Service
Service
IdP
Autenticate
& Authorize
Service 2 Service Auth
Why do we need S2S Auth?
• Authorize service calls without user context ( batch jobs, async operations..)
• Protect applications storing senstive information for internal actors too
• Multi-tenant environments
Service to service auth
User Service
Amazon Cognito
Email Service
1. Auth using creds
{
“service":“com.x.service.user,
…
}
Auth Service
com.x.service.user ALLOW com.x.service.email email:send:any
Service Permission
2. Get an identitiy
3. Send identity token with
requests
Tip #5
Give identity to your applications and automate
the credential management!
Client 2 Service and Service 2 Service Auth
Service Service Service Service
Amazon Cognito
Internal Perimeter
SAML
OIDC
External Perimeter
Auth Service
S3
?
(AWS) Infra Auth
Cognito Federated Identities to the rescue
User Service
Amazon Cognito
User Pool
Amazon Cognito
Identity Federation
1. Get Identity
Token
2. Exchange
Token for
IAM
Creds
3. Access AWS
Services
That’s all
Service
?
Authenticate
& Authorize
Service
Service
Autenticate
& Authorize
Service
Service
Service
IdP
Autenticate
& Authorize
Thank you!

More Related Content

What's hot (20)

PDF
Top 50 Node.js Interview Questions and Answers | Edureka
Edureka!
 
PPTX
API Security : Patterns and Practices
Prabath Siriwardena
 
PPT
Spring Boot in Action
Alex Movila
 
PDF
API Security Best Practices & Guidelines
Prabath Siriwardena
 
PDF
How Secure Are Your APIs?
Apigee | Google Cloud
 
PDF
Spring Framework - Spring Security
Dzmitry Naskou
 
PPT
Yii framework
Pratik Gondaliya
 
PDF
FIDO2 Specifications Overview
FIDO Alliance
 
PDF
Spring Ldap
Piergiorgio Lucidi
 
PDF
APIC/DataPower security
Shiu-Fun Poon
 
PDF
Introduction to JWT and How to integrate with Spring Security
Bruno Henrique Rother
 
PDF
OAuth2 and Spring Security
Orest Ivasiv
 
PDF
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
PPTX
An Introduction to OAuth 2
Aaron Parecki
 
PPTX
Introduction to REST - API
Chetan Gadodia
 
PPTX
Json Web Token - JWT
Prashant Walke
 
PPTX
Rest API Security
Stormpath
 
PDF
Api security-testing
n|u - The Open Security Community
 
PDF
Rest API
Phil Aylesworth
 
PPTX
Spring Boot and REST API
07.pallav
 
Top 50 Node.js Interview Questions and Answers | Edureka
Edureka!
 
API Security : Patterns and Practices
Prabath Siriwardena
 
Spring Boot in Action
Alex Movila
 
API Security Best Practices & Guidelines
Prabath Siriwardena
 
How Secure Are Your APIs?
Apigee | Google Cloud
 
Spring Framework - Spring Security
Dzmitry Naskou
 
Yii framework
Pratik Gondaliya
 
FIDO2 Specifications Overview
FIDO Alliance
 
Spring Ldap
Piergiorgio Lucidi
 
APIC/DataPower security
Shiu-Fun Poon
 
Introduction to JWT and How to integrate with Spring Security
Bruno Henrique Rother
 
OAuth2 and Spring Security
Orest Ivasiv
 
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
An Introduction to OAuth 2
Aaron Parecki
 
Introduction to REST - API
Chetan Gadodia
 
Json Web Token - JWT
Prashant Walke
 
Rest API Security
Stormpath
 
Api security-testing
n|u - The Open Security Community
 
Rest API
Phil Aylesworth
 
Spring Boot and REST API
07.pallav
 

Similar to Complex architectures for authentication and authorization on AWS (20)

PPTX
Complex architectures for authentication and authorization on AWS
Boyan Dimitrov
 
PDF
Serverless Meetup - Getting started with AWS Cognito [Jul 2020]
Dhaval Nagar
 
PDF
Serverless Meetup - Authentication for Serverless Applications [Jul 2020]
Dhaval Nagar
 
PDF
CIS 2015 Extreme OAuth - Paul Meyer
CloudIDSummit
 
PDF
amazon-cognito-auth-in-minutes
Vladimir Budilov
 
PDF
Developer Tutorial: WebAuthn for Web & FIDO2 for Android
FIDO Alliance
 
PDF
[WSO2Con USA 2018] Identity APIs is the New Black
WSO2
 
PDF
CIS14: Enterprise Identity APIs
CloudIDSummit
 
PPTX
Microsoft identity manoj mittal
Manoj Mittal
 
PPTX
AWS_IoT_Device_Management_Workshop.pptx
hawkheadtrolley
 
PDF
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
Profesia Srl, Lynx Group
 
PPTX
Microservices security - jpmc tech fest 2018
MOnCloud
 
PPTX
Community call: Develop multi tenant apps with the Microsoft identity platform
Microsoft 365 Developer
 
PPTX
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
AWS User Group Kochi
 
PDF
AWS IoT Deep Dive - AWS IoT Web Day
AWS Germany
 
PPTX
Config App Registration for Sharepoint API.pptx
NorasetKrudsamai
 
PDF
MongoDB World 2019: Securing Application Data from Day One
MongoDB
 
PDF
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
Vladimir Bychkov
 
PDF
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
Vladimir Bychkov
 
PPTX
Lamdba micro service using Amazon Api Gateway
Mike Becker
 
Complex architectures for authentication and authorization on AWS
Boyan Dimitrov
 
Serverless Meetup - Getting started with AWS Cognito [Jul 2020]
Dhaval Nagar
 
Serverless Meetup - Authentication for Serverless Applications [Jul 2020]
Dhaval Nagar
 
CIS 2015 Extreme OAuth - Paul Meyer
CloudIDSummit
 
amazon-cognito-auth-in-minutes
Vladimir Budilov
 
Developer Tutorial: WebAuthn for Web & FIDO2 for Android
FIDO Alliance
 
[WSO2Con USA 2018] Identity APIs is the New Black
WSO2
 
CIS14: Enterprise Identity APIs
CloudIDSummit
 
Microsoft identity manoj mittal
Manoj Mittal
 
AWS_IoT_Device_Management_Workshop.pptx
hawkheadtrolley
 
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
Profesia Srl, Lynx Group
 
Microservices security - jpmc tech fest 2018
MOnCloud
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Microsoft 365 Developer
 
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
AWS User Group Kochi
 
AWS IoT Deep Dive - AWS IoT Web Day
AWS Germany
 
Config App Registration for Sharepoint API.pptx
NorasetKrudsamai
 
MongoDB World 2019: Securing Application Data from Day One
MongoDB
 
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
Vladimir Bychkov
 
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
Vladimir Bychkov
 
Lamdba micro service using Amazon Api Gateway
Mike Becker
 
Ad

More from Boyan Dimitrov (10)

PPTX
Building Highly Sophisticated Environments for Security and Compliance on AWS
Boyan Dimitrov
 
PDF
Observability foundations in dynamically evolving architectures
Boyan Dimitrov
 
PDF
Anatomy of the modern application stack
Boyan Dimitrov
 
PPTX
Microservices: next-steps
Boyan Dimitrov
 
PPTX
Moving to microservices – a technology and organisation transformational journey
Boyan Dimitrov
 
PPTX
Patterns for building resilient and scalable microservices platform on AWS
Boyan Dimitrov
 
PDF
Microservices and elastic resource pools with Amazon EC2 Container Service
Boyan Dimitrov
 
PDF
Monitoring microservices platform
Boyan Dimitrov
 
PPTX
Scaling micro-services Architecture on AWS
Boyan Dimitrov
 
PPTX
Scaling from 1 to 10 million users - Hailo
Boyan Dimitrov
 
Building Highly Sophisticated Environments for Security and Compliance on AWS
Boyan Dimitrov
 
Observability foundations in dynamically evolving architectures
Boyan Dimitrov
 
Anatomy of the modern application stack
Boyan Dimitrov
 
Microservices: next-steps
Boyan Dimitrov
 
Moving to microservices – a technology and organisation transformational journey
Boyan Dimitrov
 
Patterns for building resilient and scalable microservices platform on AWS
Boyan Dimitrov
 
Microservices and elastic resource pools with Amazon EC2 Container Service
Boyan Dimitrov
 
Monitoring microservices platform
Boyan Dimitrov
 
Scaling micro-services Architecture on AWS
Boyan Dimitrov
 
Scaling from 1 to 10 million users - Hailo
Boyan Dimitrov
 
Ad

Recently uploaded (20)

PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Python basic programing language for automation
DanialHabibi2
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 

Complex architectures for authentication and authorization on AWS

  • 1. Complex architectures for authentication and authorization on AWS Boyan Dimitrov Director Platform Engineering @ Sixt @nathariel September 2019
  • 2. Our Focus Today Service ? Authenticate & Authorize • Key patterns for authentication and authorization - Client to service - Service to service - Service to Infra • Focusing on the application and more complex microservices environments
  • 3. Our Focus Today Service ? Authenticate & Authorize Service Service Autenticate & Authorize Service Service Service IdP Autenticate & Authorize
  • 4. Before we begin: The Foundations OIDC ( OpenID Connect ) - a protocol for Authentication built on top of OAuth 2.0 OAUTH 2.0 – a protocol for Authorization
  • 5. Before we begin: AWS Cognito AWS Cognito User Pools AWS Cognito Federated Identities Identity providers Social Identity Providers Other Identity Providers SAML OIDC S3 EC2 Federate AuthorizeFederate
  • 6. Tip #1 If you are starting a new project on AWS involving auth and you need IdP, Use Cognito
  • 8. Auth primer Mobile Client Amazon API Gateway Custom Authorizer Amazon Cognito 1. Authenticate via credentials Service 2. Receive JWT 3. Invoke API with JWT 4. Validate JWT 6a. Check token scope 5. Return validity 6b. Invoke custom auth function Auth Service 7. Forward request
  • 9. We live in a complex world… Amazon API Gateway Amazon Cognito Service Service Service Service Service Service Service Service Service On-Prem auth auth auth auth auth auth auth Elastic Load Balancer
  • 10. • I already have a / multiple IdPs, how to integrate all of that ? • Where do we do authentication & token validation in a heterogeneous environment with various ingress points ? • How do we do authorization and on what level ? • What about service to service auth? • What about infrastructure auth ? Auth challenges in complex architectures
  • 11. Tip #2 Consider IdP Federation to simplify your problem
  • 12. Authentication: Common Identity Format Amazon Cognito Internal Perimeter SAML OIDC federate Standard Access Token External Perimeter Service Service Service Service Authenticate
  • 13. Define your authorization strategy ACL MAC DAC RBAC ADAC PBAC …
  • 14. Tip #3 If Authorization requirements are unclear, start with RBAC and complicate as needed ACL MAC DAC RBAC ADAC PBAC …
  • 15. RBAC Authorization Primer Service Service Service Service Amazon Cognito Internal Perimeter SAML OIDC External Perimeter { "name": "John Doe", "email": "[email protected]", "roles": ["finance_controller"] … } If role ==„finance_controller“... X Amazon API Gateway
  • 16. Tip #4 Do not embed volatile business roles into your applications – implement access controls around service capabilities instead
  • 17. Delegate auth to a central auth service User Service POST /users GET /users/<id> PUT /users/<id> DELETE /users/<id> API Contract Associated Permissions users:create:any users:read:any users:read:own users:update:any users:update:own users:delete:own users:delete:any { "name": "John Doe", "email": "john.doe @foo.com", "roles": ["finance_controller"], “user_id": 343242, … } Auth Service GET /users/343242 finance_controller -> users:read:own Role Permission Authorised?
  • 18. Centralised Auth Service User Service Auth Service Advantages • Externalised auth decisions and business roles management • Easier to manage and change • Single source of truth Disadvantages • Another synchronous dependency • Additional latency • Single point of failure? • Manual effort in keeping permissions up to date
  • 19. Centralised Auth Service Optimisations: automate permission discovery User ServiceAuth Service Associated Permissions users:create:any users:read:any users:read:own users:update:any users:update:own users:delete:own users:delete:any Register permissions on startup Service:Permissions Map com.x.service.user users:create:any com.x.service.user users:read:any com.x.service.user users:read:own com.x.service.user users:update:any com.x.service.user users:update:own com.x.service.user users:delete:own com.x.service.user users:delete:any
  • 20. Centralised Auth Service Optimisations: caching associated roles Associated Permissions users:create:any users:read:any users:read:own users:update:any users:update:own users:delete:own users:delete:any User ServiceAuth Service finance_controller -> com.x.service.user users:read:own Role Permission
  • 21. Centralised Auth Service Optimisations: caching associated roles Associated Permissions and Roles users:create:any users:read:any finance_controller -> users:read:own users:update:any users:update:all users:delete:own users:delete:any finance_controller ALLOW com.x.service.user users:read:own Role Permission 1. On Startup user service caches relevant roles for its permissions 2. Receive live updates during runtime User ServiceAuth Service
  • 22. Centralised Auth Service Optimisations: caching auth result User Service Auth Service Associated Permissions users:create:any users:read:any users:read:own users:update:any users:update:all users:delete:own users:delete:any { "name": "John Doe", "email": "john.doe @foo.com", "roles": ["finance_controller"], “user_id": 343242, “jti“: 21312e1d123 … }
  • 23. User Service Auth Service 1. Authorize operation 2. Cache authorization response with TTL Permissions and Cached Policy Result users:create:any users:read:any 21312e1d123 -> users:read:own users:update:any users:update:all users:delete:own users:delete:any { "name": "John Doe", "email": "john.doe @foo.com", "roles": ["finance_controller"], “user_id": 343242, “jti“: 21312e1d123 … } Centralised Auth Service Optimisations: caching auth result
  • 24. Bonus: Local token validation User Service Cache the access token JWK for local validation Amazon Cognito { "name": "John Doe", "email": "john.doe @foo.com", "roles": ["finance_controller"], … “kid": "5689example" } { “keys": [{ “kid": "5689example", “alg": "RS256" }, { … }]}
  • 25. Authorization Service Service Service Service Amazon Cognito Internal Perimeter SAML OIDC External Perimeter Auth Service “Decentralised“ authorisation
  • 26. Centralised Auth Service User Service Auth Service Advantages • Externalised auth decisions and business roles management • Easier to manage and change • Single source of truth • Decentralised token validation and auth Disadvantages • Another synchronous dependency • Additional latency • Single point of failure? • Manual effort in keeping permissions up to date
  • 27. DEMO
  • 28. Demo Architecture Auth Service Hello World Service Amazon Cognito User Pool Register a user & Authenticate Authorize hello request • Automated permission registration • Auth rules caching • Decentralised authorization • Local token validation Fetch IdP JWK Demo WebappAdmin Webapp Manage Permissions
  • 29. So far we covered… Service ? Authenticate & Authorize Service Service Autenticate & Authorize Service Service Service IdP Autenticate & Authorize
  • 31. Why do we need S2S Auth? • Authorize service calls without user context ( batch jobs, async operations..) • Protect applications storing senstive information for internal actors too • Multi-tenant environments
  • 32. Service to service auth User Service Amazon Cognito Email Service 1. Auth using creds { “service":“com.x.service.user, … } Auth Service com.x.service.user ALLOW com.x.service.email email:send:any Service Permission 2. Get an identitiy 3. Send identity token with requests
  • 33. Tip #5 Give identity to your applications and automate the credential management!
  • 34. Client 2 Service and Service 2 Service Auth Service Service Service Service Amazon Cognito Internal Perimeter SAML OIDC External Perimeter Auth Service S3 ?
  • 36. Cognito Federated Identities to the rescue User Service Amazon Cognito User Pool Amazon Cognito Identity Federation 1. Get Identity Token 2. Exchange Token for IAM Creds 3. Access AWS Services
  • 37. That’s all Service ? Authenticate & Authorize Service Service Autenticate & Authorize Service Service Service IdP Autenticate & Authorize