Authentication and Cross-BB Authorization
In order to enable the delivery of GovStack use cases, a mechanism must be defined that provides the appropriate level of access to the various building blocks by different users and organizations. This includes defining information sharing across service or organizational boundaries, enforcing appropriate roles and permissions for users, allowing user session information to be passed between building blocks, and enforcing secure access between Building Blocks (either co-located within a service, or across applications/organizations using an Information Mediator).
This document outlines key Authentication and Authorization services that will be offered by a common Authorization Service and outlines the key interactions between the Authorization Service, Identity Building Block, Information Mediator, and other Building Blocks.
Key Requirements
The Identity Building Block is responsible for handling Foundational Identity.
The Authorization Service should offer a mechanism for authentication (managing sign-on, SSO, etc), as well as authorization (mapping functional identities to a particular user, allowing roles and permissions to be assigned to a user using IAM/RBAC, and generating tokens that can be used in web requests between services).
Authentication concerns can often be centralized (SSO services). Further detail on authentication is defined in <this document>
Government-wide implementations will require multiple Authorization services to be maintained by each domain or ministry/government department, or even specific application/service. The same tools, protocols, and communication mechanisms should be used across domains.
Authentication and Authorization (IAM/Roles/Permissions/Policies) should be implemented using well-defined standards like OpenID Connect (OIDC).
Authorization services may be specific to individual applications or services as well, again using common The authorization services should be implemented as standalone Services using common tools and well-established protocols and policy languages, such as Rego or Cedar.
After user login (authentication) and retrieval of roles/permissions/policies for that user (authorization)
The Application is responsible for managing any outbound calls based on the roles/permissions for that user - whether to internal BBs or cross-organizational requests through IM.
The Application will manage the API keys/credentials needed to access any local BB APIs that it calls
We will not pass user/session information when making API calls to local BBs
We will not pass JWT tokens or roles when making API calls through Information Mediator
JWT/tokens need to be exchanged between different UIs/applications - If we need to pass control over to another app to fill in some information (giving consent, etc) - use OIDC
The Information Mediator is used to facilitate communication between different organizations. The authorization and level of access is defined at the organization level, not the user level (ie. this particular organization has permission to access this set of data)
The security server will hold/manage credentials and API keys that are needed for accessing remote services
An organization can also allow access to an individual user based on a foundational ID
IM is needed when going outside of a local network (ie. across the internet)
For accessing an existing DPG:
Set up an account/set of credentials in the other DPG/application that allows access to the APIs
The authorization services (either within the application or separate functionality) will hold the login credentials in some type of secret storage (.env file or similar mechanism)
When calling an API in the DPG, the Application should first call the DPG login API (there must be an API exposed for login) and then hold the token that is needed for API calls
The Application will pass the appropriate token on subsequent API calls to the DPG
Definitions
Application: One or more Building Blocks that may be combined with a UI and/or internal services which implement some business logic to provide a set of related services.
Authentication: This is the process of validating a set of functional user credentials which will allow them to access a system. Largely synonymous with ‘Login’
Authorization: A mechanism to determine if a user has permissions to perform a particular action, and/or what roles/permission a particular user has within a system.
Foundational Identity: a unique identifier for an entity that corresponds with a national identification system
Functional Identity: a login or user account that is associated with a particular application or set of services
Information Mediator: Connects applications across the internet, allowing services that are owned by different organizations to share data securely and using agreed-upon rules
Organization: An entity that maintains one or more applications or services that may be consumed by other organizations
Service: An API or endpoint provided by a Building Block or internal microservice of the Application
Session: a set of information (or token) that provides context to a particular user interaction with an application (ie. keeping track of a logged-in user and what they have permission to do while they are logged in for a particular period of time)
Use Case/User Journey: A system involving one or more UX components that allows a user to access multiple services which may be co-located or require the use of an information mediator to access a set of services/applications.
User: An individual that is accessing a particular application or set of services
Scenarios
Authentication and Authorization flow
Notes:
The Mapping of foundational ID to functional ID for this application can happen in ID BB or in auth services.
Application is then responsible for managing control and access for this user, based on their permission bundle
Co-located services
An application will use an authorization Building Block for user login and role/permission management. The application will ensure that any outbound requests are filtered by that user’s role. A token does not need to be passed to Building Blocks when calling a service endpoint.
If the application needs to call another application which will present a UI, then a token should be passed to the second application containing the user information.