Skip to content

PG-2238 - Add the OIDC topic#930

Open
Andriciuc wants to merge 3 commits into18from
add-oidc-validator-topic
Open

PG-2238 - Add the OIDC topic#930
Andriciuc wants to merge 3 commits into18from
add-oidc-validator-topic

Conversation

@Andriciuc
Copy link
Copy Markdown
Contributor

This PR reorganizes the authentication methods in Solutions, adding a folder to future proof the authentication methods, and adds the OIDC topic.

This PR reorganizes the authentication methods in Solutions, adding a folder to future proof the authentication methods, and adds the OIDC topic.
- add content to oidc, which includes beginner explanations for authentication flow, why use OIDC and standard setup from the PG side.
- Add buttons to overview, and add a lot of links to the oidc chapter for all of our sources.

Percona Distribution for PostgreSQL supports OIDC authentication through the `pg_oidc_validator` library. This library validates OIDC tokens during PostgreSQL authentication.

If you want to test PostgreSQL OAuth authentication using `pg_oidc_validator` with Keycloak using Docker containers, see the [PostgreSQL OIDC Authentication with pg_oidc_validator :octicons-link-external-16:](https://www.percona.com/blog/postgresql-oidc-authentication-with-pg_oidc_validator/) blog post.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also support other providers (Ping, Okta, etc), I'm not sure if only mentioning keycloak here is a good idea. (or generally, is it okay for the more "stable" documentation to link to "written once, not maintained later" blog posts? things will change)


The following diagram shows how OIDC authentication works between the client, the identity provider, and PostgreSQL:

![OIDC authentication flow](../../_images/diagrams/oidc-auth-flow.svg)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't our documentation site supports mermaid or something similar, so we can include the "source" of this graph instead of the image directly? This is not maintainable in the long term, if somebody else has to modify the image later.

For Debian/Ubuntu:

```bash
sudo apt install pg-oidc-validator-pgdg{{pgversion}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we or pgdg actually publish this package, or the RHEL one? I don't remember these, and I definitely can't find them in the official debian/ubuntu packages. If it is part of a different repository, that should be also mentioned.

* `scope` is the required OIDC scope
* `issuer` is the URL of the OIDC identity provider

4. Restart PostgreSQL for the changes to take effect:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oauth_validator_libraries and pg_hba are both SIGHUP-aware, so a reload is enough, you don't have to restart.

```

!!! important
PostgreSQL does not issue OIDC tokens. Clients must obtain an access token from an external identity provider such as Keycloak, Okta, or Microsoft Entra ID before connecting.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we again mention some specific providers - if we do mention some, we should have one consistent list.


## Available authentication methods

### LDAP authentication
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the order here, OIDC is the preferred solution over LDAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants