What is OIDC?
OpenID Connect (OIDC) is a simple identity layer on top of the OAuth 2.0 protocol, which allows clients to verify identity. OIDC leverages a JWT (JSON Web Token) that contains claims about the caller. Claims are statements that can include information such as name, email address, or repository metadata. OIDC provides a reliable way to establish a user’s identity, including authentication and basic profile information. It gives third-party applications a standardized, secure, and scalable method to authenticate and authorize users. When used with Ona, it helps automate secure access to third-party services that your environments might need to interact with.Setting up OIDC Authentication with a third party
Setting up OIDC Authentication generally involves three main steps:- Establish Trust: Register Ona with your OIDC-supported third party (like AWS, Google, etc.). This third party becomes the audience in your JWT token generated in Ona.
- Setup Trust Rules: Configure what the JWT claims must contain to be exchanged for a valid auth token. Here you can implement fine-grained access controls.
-
Exchange the JWT token: Once trust and trust rules are established, use the JWT tokens generated by the
gitpod idp token
command to authenticate with the third party.
Provider specific guides
Read more:Ona CLI integration
You can retrieve a JWT token for OIDC usinggitpod idp
. To retrieve the OIDC token for the current environment, run gitpod idp token
.
For example, to request a new OIDC JWT for example.org, execute:
--decode
flag:
Access Control Examples
Granting access to anyone in the organization
Depending on the Principal using the system, thesub
claim will have the following format:
- Users:
sub: "org:<orgID>/user:<userID>"
- Runners:
sub: "org:<orgID>/rnr:<runnerID>"
- Environments without a Project:
sub: "org:<orgID>/env:<environmentID>"
- Environments from a Project:
sub: "org:<orgID>/prj:<projectID>/env:<environmentID>"
Granting access to anyone in the organization
You can configure your third-party service to grant access based on theorg:<orgID>
prefix.
Granting access to an Environment created from a specific project
You can grant your third-party service access to an environment created from a specific project by matching theorg:<orgID>/prj:<projectID>
prefix.
Grant access to a specific Environment
You can grant your third-party service access to a specific environment by matching theorg:<orgID>/prj:<projectID>/env:<environmentID>
prefix.