You need two roles. Both can be in the same auth method mount (yes, it is somewhat confusing that the same auth method can be mounted under the names oidc or jwt - which behave exactly the same - yet once mounted, each role has a role_type setting which can also be oidc or jwt, which controls how that role behaves).
Some small amount of the configuration will be the same between roles. Not all of it though - some fields only apply to one type or the other.
Both can be in the same auth method mount (yes, it is somewhat confusing that the same auth method can be mounted under the names oidc or jwt - which behave exactly the same - yet once mounted
Actually, i have 2 auth methods:
jwt mounted in jwt/ with auth/jwt/role/default
oidc in oidc/ with auth/oidc/role/default
Si i need to configure create a new jwt role under auth/oidc/role ? How i do that
You are welcome to do this if you wish, and may be forced to if you have a requirement to have different configurations written to auth/jwt/config and auth/oidc/config, that cannot be merged into one.
However, if you do this, the same user logging in via oidc/ and jwt/ will count as two distinct users to Vault. This may or may not matter to you, depending on whether you’re being billed for Vault Enterprise, and which Vault features you are using.
The other option is to create (for example) a role named api-auth at auth/oidc/role/api-auth - docs: JWT/OIDC - Auth Methods - HTTP API | Vault | HashiCorp Developer specifying (amongst other settings) role_type=jwt, and have your services log in by writing to auth/oidc/login with role=api-auth.
It’s up to you how you want to assemble the various building blocks Vault provides.
Apologies… I trusted the Vault API design to make sense, and believed that since role_type is configurable per role, it would actually be possible to make use of that feature.
Digging around in the code (in https://github.dev/hashicorp/vault-plugin-auth-jwt) I have now come to the conclusion that, due to other restrictions in the code, it’s impossible to get a working configuration with mixed role_types in a single oidc/jwt mount… which is such a silly restriction
Sorry for taking you down a misleading route… I guess you really do need to go back to using a separate auth/jwt/login endpoint on a separate auth mount.