Gentics Mesh comes with support for Keycloak built-in, but I'd like to use Okta instead.
What's best practice?
Would it require modifying Mesh source code?
Or maybe I should handle authentication in a middleware layer?
Or could I implement the AuthServicePlugin to validate a token from Okta?
https://github.com/gentics/mesh/blob/dev/plugin-api/src/main/java/com/gentics/mesh/plugin/auth/AuthServicePlugin.java
Update
I've tried using my Okta server in the mesh.yml config, but an exception is thrown.
This is the OIDC url for my Okta service -
https://{yourOktaDomain}/oauth2/v1/authorize
Unfortunately, the OAuth2 implementation seems to be Keycloak specific -
com.gentics.mesh.core.rest.error.GenericRestException: 500 Internal Server Error oauth_config_error
at com.gentics.mesh.core.rest.error.Errors.error(Errors.java:124)
...
Caused by: java.lang.RuntimeException: Error while loading realm info. Got code {404}
at com.gentics.mesh.auth.MeshOAuth2ServiceImpl.fetchPublicRealmInfo(MeshOAuth2ServiceImpl.java:451)
It looks like it's piecing together a url that won't work for Okta.
https://github.com/gentics/mesh/blob/f85dac8bf954248a6556323d792e6b849fb1d593/services/keycloak-auth/src/main/java/com/gentics/mesh/auth/MeshOAuth2ServiceImpl.java#L434
If I'm not mistaken, the implementation [MeshOAuth2ServiceImpl] can be changed to support any OIDC.