hashicorp / hashicorp/vault-plugin-auth-jwt

Support public OIDC clients without the client-secret defined

Open
#116 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
107
Forks
73
Avg merge
13h 49m
Merged PRs (30d)
7

Description

### Description

As of now vault throwing `* both 'oidc_client_id' and 'oidc_client_secret' must be set for OIDC` error message if `oidc_client_secret` was not set. Most probably, a new additional flag would be required to define public OIDC client behavior.

### Current behavior

Working

```
vault write auth/oidc/config \
bound_issuer="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_url="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_ca_pem=@tls/ca.pem \
oidc_client_id='vault' \
oidc_client_secret='vault' \
default_role='oidc-reader'
```

Not working

```
vault write auth/oidc/config \
bound_issuer="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_url="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_ca_pem=@tls/ca.pem \
oidc_client_id='vault' \
default_role='oidc-reader'
```

### Expected behavior

Both command should finish OIDC method configuration without an error

```
vault write auth/oidc/config \
bound_issuer="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_url="https://${MACHINE_IP}:5556/dex" \
oidc_discovery_ca_pem=@tls/ca.pem \
oidc_client_id='vault' \
oidc_client_public=yes \
default_role='oidc-reader'
```

### Misc

Error happens at

https://github.com/hashicorp/vault-plugin-auth-jwt/blob/master/path_config.go#L200

As a workaround I was able to configure OIDC backend with the random gibberish supplied into `oidc_client_secret` parameter, but during the authentication process it failed with

```
Error exchanging oidc code: "oauth2: cannot fetch token: 401 Unauthorized\nResponse: {\"error\":\"invalid_client\",\"error_description\":\"Invalid client credentials.\"}"
```

In the same time a plain HTTP API request with curl and only `client_id` specified worked as expected, provided me Bearer token

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.