0

How to Assert OAM token in helidon using OIDC?

I was trying to assert OAM token but getting error as shown below and I tried asserting IDCS token and it works fine

Exception in thread “main” io.helidon.common.Errors$ErrorMessagesException: [FATAL: Failed to load metadata: io.helidon.common.configurable.ResourceException: Failed to open stream to uri: https://{{OAM_host}}:{{port}}/.well-known/openid-configuration at io.helidon.common.configurable.ResourceException: Failed to open stream to uri: https://{{OAM_host}}:{{port}}/.well-known/openid-configuration, FATAL: When token_endpoint is not explicitly defined, the OIDC metadata must exist at class io.helidon.security.providers.oidc.common.OidcConfig$Builder, FATAL: When authorization_endpoint is not explicitly defined, the OIDC metadata must exist at class io.helidon.security.providers.oidc.common.OidcConfig$Builder, FATAL: When jwks_uri is not explicitly defined, the OIDC metadata must exist at class io.helidon.security.providers.oidc.common.OidcConfig$Builder]

And in the application.properties added OAM details:

providers:
    - abac:
    - oidc:
        client-id: "${ALIAS=security.properties.client-id}"
        client-secret: "${ALIAS=security.properties.client-secret}"
        identity-uri: "${ALIAS=security.properties.uri}"
        # A prefix used for custom scopes
        scope-audience: "${ALIAS=security.properties.scope-audience}"
        audience: "${ALIAS=security.properties.audience}"
        proxy-host: "${ALIAS=security.properties.proxy-host}"
        frontend-uri: "${ALIAS=security.properties.frontend-uri}"
        cookie-name: "OIDC_SESSION"
        cookie-same-site: "Lax"
        header-use: true
        redirect: false

Am I missing something here?

ESCoder
  • 15,431
  • 2
  • 19
  • 42

1 Answers1

0

If you look at your exception, it points out the endpoint is not valid:

https://{{OAM_host}}:{{port}}/.well-known/openid-configuration

This means your configuration contains {{OAM_host}} and {{port}} - such placeholders are not replaced by Helidon configuration.

In Helidon 1.x you can use the ${ALIAS=key} to reference keys

Since Helidon 2.0.0-M2 you can use ${key} to reference key

Tomas Langer
  • 451
  • 3
  • 5