SlideShare uma empresa Scribd logo
1 de 16
© 2016 ForgeRock. All rights reserved.
An Authentication and
Authorization Architecture
for a Microservices World
David Ferriera, Director – Cloud Technology, Forgerock
david.ferriera@forgerock.com
Presented at SpringOnePlatform 2016
1
© 2016 ForgeRock. All rights reserved.
The Identity Layers
Who or What Layer
App/API
Consumers
(Browser, REST)
Service
(API, MySql, Redis,
OpenAM)
Platform
(cf push, DevMgr,
CI/CD pipeline)
System
(OpsMgr, BOSH,SSH)
Users Devices Things Applications Services
Developers
Operators
Services External ServicesApplications
© 2016 ForgeRock. All rights reserved.
Microservices
Pivotal Cloud Foundry
© 2016 ForgeRock. All rights reserved.
OpenAM
Authorization too
A A A
A A
A A
A A
A A
A A
A
Policies
 CONTEXT AWARE USING
ENVIRONMENTAL ATTRIBUTES
 RULES EVALUATED IN REAL TIME
BY THE AUTHORIZATION ENGINE
 FINE GRAINED ACCESS CONTROL
 ROLE NAMES MIGHT BE SEEN AS
ATTRIBUTES
PIP
ATTRIBUTE BASED ACCESS CONTROL
© 2016 ForgeRock. All rights reserved.
Protocols
Oauth 2 – RFC 6749:
“The OAuth 2.0 authorization framework enables a third-party application to
obtain limited access to an HTTP service, either on behalf of a resource
owner by orchestrating an approval interaction between the resource owner
and the HTTP service, or by allowing the third-party application to obtain
access on its own behalf.”
OpenID Connect (OIDC) :
“OpenID Connect 1.0 is a simple identity layer on top of the OAuth 2.0
protocol. It enables Clients to verify the identity of the End-User based on
the authentication performed by an Authorization Server, as well as to
obtain basic profile information about the End-User in an interoperable and
REST-like manner.”
Oauth 2 – Bearer Token usage - RFC 6750:
“This specification describes how to use bearer tokens in HTTP requests to
access OAuth 2.0 protected resources. Any party in possession of a bearer
token (a "bearer") can use it to get access to the associated resources
(without demonstrating possession of a cryptographic key). To prevent
misuse, bearer tokens need to be protected from disclosure in storage and
in transport.
© 2016 ForgeRock. All rights reserved.
Tokens: Types/Format
Access Token
• Part of Oauth, presented with each transaction
• can be opaque or JWT
• can be stateful or stateless
• Shorter TTL
Refresh Token
• Part of Oauth, received along with first access token after authentication to the auth server
• Used to request a new access token from the auth server, no credentials required
• Longer TTL
• Must be stored securely
ID Token
• Part of OIDC
• Contains Identity information about authenticated user
• Received in addition to the 2 oauth tokens
• Must be JW
• Longer TTL
JSON Web Tokens (JWT)
• Token format specified by OpenID Connect for the Identity Token
• Multiple levels of security possible (JWE, JWS, JOSE)
• Usually stateless
© 2016 ForgeRock. All rights reserved.
Tokens: Performance vs. Security
Stateful
• Sessions stored on server
• Token is opaque
• Tokens must be validated with the server
• Server handles authorization
• Better logout
Stateless
• Sessions not stored on server
• Token may be introspected
• Tokens validated locally
• Microservice must handle authorization
• Tokens difficult to revoke before TTL
Token Performance Security
State Stateless Statefull
Encrypt JWT
Body
No Yes
Validate w/Auth
server
No Yes
Validate all
tokens
No Yes
TTL’s Longer Shorter
© 2016 ForgeRock. All rights reserved.
Tokens: OpenAM response
stateless response
{
"access_token":
"eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAic3ViIjogImRlbW8iLCAiYXVkaXRUcmFja2luZ0lkIjogImQ3M2U5MzkwLTUyYWEtNDU5
Ni04NzgxLWZkZjFlNTI0YTE0MCIsICJpc3MiOiAiaHR0cDovL2thanZtLmV4YW1wbGUuY29tOjgwODAvb3BlbmFtL29hdXRoMiIsICJ0b2tlbk5hbW
UiOiAiYWNjZXNzX3Rva2VuIiwgInRva2VuX3R5cGUiOiAiQmVhcmVyIiwgImF1dGhHcmFudElkIjogIjU4MjhkODczLWU4NmMtNGJhYi05ZTQwLT
kwMDFkYjlhYzYyZCIsICJhdWQiOiAiY2xpZW50IiwgIm5iZiI6IDE0Njc3MzU3NjcsICJzY29wZSI6IFsgInNjb3BlIiBdLCAicmVhbG0iOiAiLyIsICJleH
AiOiAxNDY3NzM5MzY3LCAiaWF0IjogMTQ2NzczNTc2NywgImV4cGlyZXNfaW4iOiAzNjAwMDAwLCAianRpIjogIjBmMDE2Zjk3LWMwYjItNGIx
Mi04NjMzLWQwMTQ1Yjk0NDMxYyIgfQ.pq5yJtq1kGi4VaGIMOtusRD2G_f2VJrq2FKx0mhS2rQ",
"refresh_token":
"eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAic3ViIjogImRlbW8iLCAiYXVkaXRUcmFja2luZ0lkIjogImQ5ZmYzMGYwLTUxM2ItNDgw
MS05ZmNlLTFhYzZlNGFiMTNmMyIsICJpc3MiOiAiaHR0cDovL2thanZtLmV4YW1wbGUuY29tOjgwODAvb3BlbmFtL29hdXRoMiIsICJ0b2tlbk5h
bWUiOiAicmVmcmVzaF90b2tlbiIsICJhdXRoTW9kdWxlcyI6ICJEYXRhU3RvcmUiLCAidG9rZW5fdHlwZSI6ICJCZWFyZXIiLCAiYXV0aEdyYW50
SWQiOiAiNTgyOGQ4NzMtZTg2Yy00YmFiLTllNDAtOTAwMWRiOWFjNjJkIiwgImF1ZCI6ICJjbGllbnQiLCAibmJmIjogMTQ2NzczNTc2NywgInNjb
3BlIjogWyAic2NvcGUiIF0sICJyZWFsbSI6ICIvIiwgImV4cCI6IDE0NjgzNDA1NjcsICJpYXQiOiAxNDY3NzM1NzY3LCAiZXhwaXJlc19pbiI6IDYwN
DgwMDAwMCwgImp0aSI6ICI0OWMyMzhkNC1jNmY5LTQzMzMtYTZiMC04YzEzMjNlNGU0MTIiIH0.5TQnJQXqIpW_bG6jbqDX9VdulJByNZm
PTvOmI1Ui6c8",
"scope": "scope",
"token_type": "Bearer",
"expires_in": 3599
}
© 2016 ForgeRock. All rights reserved.
Tokens: Decoded @ jwt.io
© 2016 ForgeRock. All rights reserved.
Service to Service: Oauth Bearer token - stateful
mservice-1 OpenAM mservice-2
{Client Credentials}
Request Token
{access token, refresh
token, metadata}
Response
{Access Token}
Service Request
{Client Credentials,
access token}
Token Validation Request
{token_expires}
Response
{data payload}
Response
© 2016 ForgeRock. All rights reserved.
Microservice Tiers – An Identity View
Tier-2-service
Exposed external and internal
Consumer and service identities
High level of security
Internal
Consumer and service identities
required
Internal
service identities only
Tier-1-service
Tier-2-service
Tier-1-service
Tier-3-service Tier-3-service
© 2016 ForgeRock. All rights reserved.
Tier 1 and 2 microservices - stateless
Tier-1-
application OpenAM
Tier-2-
service
{Client Credentials}
Request Token
{access token, refresh
token, metadata}
Response
{consumer Access Tokenconsumer
IDToken, service access token
Service Request
{data payload}
Response
External
Consumer
302 redirect – Auth server
302 redirect – w/ auth code
Request protected app
{username,password} + consent
{Auth code}
{access token, refresh token, ID Token
metadata}
{data payload}
Stateless token validated by
microservice
© 2016 ForgeRock. All rights reserved.
Cloud Foundry Route Service
Cloud
Controller
Service Broker
Service Broker
App 1
Service 1
Service 2
OpenAM
Browser
1
2
3
4
5
Cloud Foundry
1. A previously logged in user makes
a request to an app with a bound
route service. (Could be browser
flow or API flow)
2. Router sends request to the service
3. Service validates token and grabs
additional data from profile and
adds it to the body of the JWT, and
sets the appropriate header to tell
the router the request can continue.
4. Router passes the request through
to the appropriate app.
5. The app, using the key it received
at bind time, validates the signature
of the token, unpacks the data from
the body and acts accordingly.
Router
© 2016 ForgeRock. All rights reserved.
Forgerock Service Broker Roadmap
Cloud Foundry Integration Release Estimate
Alpha Service Broker Q2 2016
GA Service Broker – Oauth 2 Q3 2016
Pivotal Tile Q3 2016
GA Service Broker - OIDC Q4 2016
GA Route Service – SB enabled Q4 2016
© 2016 ForgeRock. All rights reserved.
Forgerock Software Download
https://backstage.forgerock.com/#!/downloads
© 2016 ForgeRock. All rights reserved.
References
OpenID Connect
http://openid.net/specs/openid-connect-core-1_0.html
Oauth 2
https://tools.ietf.org/html/rfc6749
https://tools.ietf.org/html/rfc6750
JSON Web Tokens
https://tools.ietf.org/html/rfc7519
Javascript Object Signing and Encryption
https://datatracker.ietf.org/wg/jose/documents/

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Clean architectures with fast api pycones
Clean architectures with fast api   pyconesClean architectures with fast api   pycones
Clean architectures with fast api pycones
 
Deep dive into AWS IAM
Deep dive into AWS IAMDeep dive into AWS IAM
Deep dive into AWS IAM
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
Elastic stack Presentation
Elastic stack PresentationElastic stack Presentation
Elastic stack Presentation
 
Amazon ECS
Amazon ECSAmazon ECS
Amazon ECS
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
Amazon CloudFront 101
Amazon CloudFront 101Amazon CloudFront 101
Amazon CloudFront 101
 
Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)
 
IAM Best Practices
IAM Best PracticesIAM Best Practices
IAM Best Practices
 
Kong
KongKong
Kong
 
Amazon Virtual Private Cloud (VPC): Networking Fundamentals and Connectivity ...
Amazon Virtual Private Cloud (VPC): Networking Fundamentals and Connectivity ...Amazon Virtual Private Cloud (VPC): Networking Fundamentals and Connectivity ...
Amazon Virtual Private Cloud (VPC): Networking Fundamentals and Connectivity ...
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Cognito Customer Deep Dive
Cognito Customer Deep DiveCognito Customer Deep Dive
Cognito Customer Deep Dive
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
Welcome to the Jungle: Pentesting AWS
Welcome to the Jungle: Pentesting AWSWelcome to the Jungle: Pentesting AWS
Welcome to the Jungle: Pentesting AWS
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...
 
Micro services vs Monolith Architecture
Micro services vs Monolith ArchitectureMicro services vs Monolith Architecture
Micro services vs Monolith Architecture
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS Security
 
Service Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices ArchitectureService Discovery and Registration in a Microservices Architecture
Service Discovery and Registration in a Microservices Architecture
 

Semelhante a An Authentication and Authorization Architecture for a Microservices World

170724 JP/UK Open Banking Summit English Translation
170724 JP/UK Open Banking Summit English Translation170724 JP/UK Open Banking Summit English Translation
170724 JP/UK Open Banking Summit English Translation
Nat Sakimura
 

Semelhante a An Authentication and Authorization Architecture for a Microservices World (20)

ForgeRock Platform Release - Summer 2016
ForgeRock Platform Release - Summer 2016  ForgeRock Platform Release - Summer 2016
ForgeRock Platform Release - Summer 2016
 
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares
 
FIDO Technical Overview at FIDO KWG Hackathon
FIDO Technical Overview at FIDO KWG HackathonFIDO Technical Overview at FIDO KWG Hackathon
FIDO Technical Overview at FIDO KWG Hackathon
 
INTERFACE, by apidays - The Evolution of API Security by Johann Dilantha Nal...
INTERFACE, by apidays  - The Evolution of API Security by Johann Dilantha Nal...INTERFACE, by apidays  - The Evolution of API Security by Johann Dilantha Nal...
INTERFACE, by apidays - The Evolution of API Security by Johann Dilantha Nal...
 
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
 
OpenId Connect Protocol
OpenId Connect ProtocolOpenId Connect Protocol
OpenId Connect Protocol
 
API Security In Cloud Native Era
API Security In Cloud Native EraAPI Security In Cloud Native Era
API Security In Cloud Native Era
 
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
2022 APIsecure_Why Assertion-based Access Token is preferred to Handle-based ...
 
Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?Why Assertion-based Access Token is preferred to Handle-based one?
Why Assertion-based Access Token is preferred to Handle-based one?
 
170724 JP/UK Open Banking Summit English Translation
170724 JP/UK Open Banking Summit English Translation170724 JP/UK Open Banking Summit English Translation
170724 JP/UK Open Banking Summit English Translation
 
How to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects
How to Make Your IoT Devices Secure, Act Autonomously & Trusted SubjectsHow to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects
How to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects
 
O auth2.0 guide
O auth2.0 guideO auth2.0 guide
O auth2.0 guide
 
apidays Helsinki & North 2023 - API authorization with Open Policy Agent, And...
apidays Helsinki & North 2023 - API authorization with Open Policy Agent, And...apidays Helsinki & North 2023 - API authorization with Open Policy Agent, And...
apidays Helsinki & North 2023 - API authorization with Open Policy Agent, And...
 
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
 
OAuth2
OAuth2OAuth2
OAuth2
 
Api security
Api security Api security
Api security
 
De la bonne utilisation de OAuth2
De la bonne utilisation de OAuth2 De la bonne utilisation de OAuth2
De la bonne utilisation de OAuth2
 
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
 
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
apidays LIVE Hong Kong 2021 - Digital Identity Centric Approach to Accelerate...
 

Mais de VMware Tanzu

Mais de VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

An Authentication and Authorization Architecture for a Microservices World

  • 1. © 2016 ForgeRock. All rights reserved. An Authentication and Authorization Architecture for a Microservices World David Ferriera, Director – Cloud Technology, Forgerock david.ferriera@forgerock.com Presented at SpringOnePlatform 2016 1
  • 2. © 2016 ForgeRock. All rights reserved. The Identity Layers Who or What Layer App/API Consumers (Browser, REST) Service (API, MySql, Redis, OpenAM) Platform (cf push, DevMgr, CI/CD pipeline) System (OpsMgr, BOSH,SSH) Users Devices Things Applications Services Developers Operators Services External ServicesApplications
  • 3. © 2016 ForgeRock. All rights reserved. Microservices Pivotal Cloud Foundry
  • 4. © 2016 ForgeRock. All rights reserved. OpenAM Authorization too A A A A A A A A A A A A A A Policies  CONTEXT AWARE USING ENVIRONMENTAL ATTRIBUTES  RULES EVALUATED IN REAL TIME BY THE AUTHORIZATION ENGINE  FINE GRAINED ACCESS CONTROL  ROLE NAMES MIGHT BE SEEN AS ATTRIBUTES PIP ATTRIBUTE BASED ACCESS CONTROL
  • 5. © 2016 ForgeRock. All rights reserved. Protocols Oauth 2 – RFC 6749: “The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf.” OpenID Connect (OIDC) : “OpenID Connect 1.0 is a simple identity layer on top of the OAuth 2.0 protocol. It enables Clients to verify the identity of the End-User based on the authentication performed by an Authorization Server, as well as to obtain basic profile information about the End-User in an interoperable and REST-like manner.” Oauth 2 – Bearer Token usage - RFC 6750: “This specification describes how to use bearer tokens in HTTP requests to access OAuth 2.0 protected resources. Any party in possession of a bearer token (a "bearer") can use it to get access to the associated resources (without demonstrating possession of a cryptographic key). To prevent misuse, bearer tokens need to be protected from disclosure in storage and in transport.
  • 6. © 2016 ForgeRock. All rights reserved. Tokens: Types/Format Access Token • Part of Oauth, presented with each transaction • can be opaque or JWT • can be stateful or stateless • Shorter TTL Refresh Token • Part of Oauth, received along with first access token after authentication to the auth server • Used to request a new access token from the auth server, no credentials required • Longer TTL • Must be stored securely ID Token • Part of OIDC • Contains Identity information about authenticated user • Received in addition to the 2 oauth tokens • Must be JW • Longer TTL JSON Web Tokens (JWT) • Token format specified by OpenID Connect for the Identity Token • Multiple levels of security possible (JWE, JWS, JOSE) • Usually stateless
  • 7. © 2016 ForgeRock. All rights reserved. Tokens: Performance vs. Security Stateful • Sessions stored on server • Token is opaque • Tokens must be validated with the server • Server handles authorization • Better logout Stateless • Sessions not stored on server • Token may be introspected • Tokens validated locally • Microservice must handle authorization • Tokens difficult to revoke before TTL Token Performance Security State Stateless Statefull Encrypt JWT Body No Yes Validate w/Auth server No Yes Validate all tokens No Yes TTL’s Longer Shorter
  • 8. © 2016 ForgeRock. All rights reserved. Tokens: OpenAM response stateless response { "access_token": "eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAic3ViIjogImRlbW8iLCAiYXVkaXRUcmFja2luZ0lkIjogImQ3M2U5MzkwLTUyYWEtNDU5 Ni04NzgxLWZkZjFlNTI0YTE0MCIsICJpc3MiOiAiaHR0cDovL2thanZtLmV4YW1wbGUuY29tOjgwODAvb3BlbmFtL29hdXRoMiIsICJ0b2tlbk5hbW UiOiAiYWNjZXNzX3Rva2VuIiwgInRva2VuX3R5cGUiOiAiQmVhcmVyIiwgImF1dGhHcmFudElkIjogIjU4MjhkODczLWU4NmMtNGJhYi05ZTQwLT kwMDFkYjlhYzYyZCIsICJhdWQiOiAiY2xpZW50IiwgIm5iZiI6IDE0Njc3MzU3NjcsICJzY29wZSI6IFsgInNjb3BlIiBdLCAicmVhbG0iOiAiLyIsICJleH AiOiAxNDY3NzM5MzY3LCAiaWF0IjogMTQ2NzczNTc2NywgImV4cGlyZXNfaW4iOiAzNjAwMDAwLCAianRpIjogIjBmMDE2Zjk3LWMwYjItNGIx Mi04NjMzLWQwMTQ1Yjk0NDMxYyIgfQ.pq5yJtq1kGi4VaGIMOtusRD2G_f2VJrq2FKx0mhS2rQ", "refresh_token": "eyAidHlwIjogIkpXVCIsICJhbGciOiAiSFMyNTYiIH0.eyAic3ViIjogImRlbW8iLCAiYXVkaXRUcmFja2luZ0lkIjogImQ5ZmYzMGYwLTUxM2ItNDgw MS05ZmNlLTFhYzZlNGFiMTNmMyIsICJpc3MiOiAiaHR0cDovL2thanZtLmV4YW1wbGUuY29tOjgwODAvb3BlbmFtL29hdXRoMiIsICJ0b2tlbk5h bWUiOiAicmVmcmVzaF90b2tlbiIsICJhdXRoTW9kdWxlcyI6ICJEYXRhU3RvcmUiLCAidG9rZW5fdHlwZSI6ICJCZWFyZXIiLCAiYXV0aEdyYW50 SWQiOiAiNTgyOGQ4NzMtZTg2Yy00YmFiLTllNDAtOTAwMWRiOWFjNjJkIiwgImF1ZCI6ICJjbGllbnQiLCAibmJmIjogMTQ2NzczNTc2NywgInNjb 3BlIjogWyAic2NvcGUiIF0sICJyZWFsbSI6ICIvIiwgImV4cCI6IDE0NjgzNDA1NjcsICJpYXQiOiAxNDY3NzM1NzY3LCAiZXhwaXJlc19pbiI6IDYwN DgwMDAwMCwgImp0aSI6ICI0OWMyMzhkNC1jNmY5LTQzMzMtYTZiMC04YzEzMjNlNGU0MTIiIH0.5TQnJQXqIpW_bG6jbqDX9VdulJByNZm PTvOmI1Ui6c8", "scope": "scope", "token_type": "Bearer", "expires_in": 3599 }
  • 9. © 2016 ForgeRock. All rights reserved. Tokens: Decoded @ jwt.io
  • 10. © 2016 ForgeRock. All rights reserved. Service to Service: Oauth Bearer token - stateful mservice-1 OpenAM mservice-2 {Client Credentials} Request Token {access token, refresh token, metadata} Response {Access Token} Service Request {Client Credentials, access token} Token Validation Request {token_expires} Response {data payload} Response
  • 11. © 2016 ForgeRock. All rights reserved. Microservice Tiers – An Identity View Tier-2-service Exposed external and internal Consumer and service identities High level of security Internal Consumer and service identities required Internal service identities only Tier-1-service Tier-2-service Tier-1-service Tier-3-service Tier-3-service
  • 12. © 2016 ForgeRock. All rights reserved. Tier 1 and 2 microservices - stateless Tier-1- application OpenAM Tier-2- service {Client Credentials} Request Token {access token, refresh token, metadata} Response {consumer Access Tokenconsumer IDToken, service access token Service Request {data payload} Response External Consumer 302 redirect – Auth server 302 redirect – w/ auth code Request protected app {username,password} + consent {Auth code} {access token, refresh token, ID Token metadata} {data payload} Stateless token validated by microservice
  • 13. © 2016 ForgeRock. All rights reserved. Cloud Foundry Route Service Cloud Controller Service Broker Service Broker App 1 Service 1 Service 2 OpenAM Browser 1 2 3 4 5 Cloud Foundry 1. A previously logged in user makes a request to an app with a bound route service. (Could be browser flow or API flow) 2. Router sends request to the service 3. Service validates token and grabs additional data from profile and adds it to the body of the JWT, and sets the appropriate header to tell the router the request can continue. 4. Router passes the request through to the appropriate app. 5. The app, using the key it received at bind time, validates the signature of the token, unpacks the data from the body and acts accordingly. Router
  • 14. © 2016 ForgeRock. All rights reserved. Forgerock Service Broker Roadmap Cloud Foundry Integration Release Estimate Alpha Service Broker Q2 2016 GA Service Broker – Oauth 2 Q3 2016 Pivotal Tile Q3 2016 GA Service Broker - OIDC Q4 2016 GA Route Service – SB enabled Q4 2016
  • 15. © 2016 ForgeRock. All rights reserved. Forgerock Software Download https://backstage.forgerock.com/#!/downloads
  • 16. © 2016 ForgeRock. All rights reserved. References OpenID Connect http://openid.net/specs/openid-connect-core-1_0.html Oauth 2 https://tools.ietf.org/html/rfc6749 https://tools.ietf.org/html/rfc6750 JSON Web Tokens https://tools.ietf.org/html/rfc7519 Javascript Object Signing and Encryption https://datatracker.ietf.org/wg/jose/documents/