nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
454 stars 320 forks source link

Declarative configuration #136

Closed affanshahid closed 4 years ago

affanshahid commented 4 years ago

Does this plugin support Kong's DB-less mode through a configuration file? If so how should I define the options, currently I am getting errors in my config file about unknown_properties

gwaldisp commented 4 years ago

Based on the information here it looks like it’s not supported:

https://docs.konghq.com/1.3.x/db-less-and-declarative-config/#plugin-compatibility https://docs.konghq.com/1.3.x/db-less-and-declarative-config/#plugin-compatibility

On 23 Oct, 2019, at 13:22, affanshahid notifications@github.com wrote:

Does this plugin support Kong's DB-less mode through a configuration file? If so how should I define the options, currently I am getting errors in my config file about unknown_properties

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nokia/kong-oidc/issues/136?email_source=notifications&email_token=AK5B63ITNWLC5IZOI5ZVTHLQQAXWXA5CNFSM4JD72VB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HTZFJGQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5B63KJIAOTHKD4JTLCQPTQQAXWXANCNFSM4JD72VBQ.

affanshahid commented 4 years ago

It does seem to be supported and working, I just had to change the configuration a bit, perhaps this could be documented. My config now looks likes this:

services:
  - name: config
    url: http://example.com
    # Entities can store tags as metadata
    tags:
      - config
    # Entities that have a foreign-key relationship can be nested:
    routes:
      - name: config-api
        paths:
          - /config
        strip_path: true
        # preserve_host: true
    plugins:
      - name: cors
      - name: oidc
        config: 
          client_secret: secret
          client_id: kong 
          bearer_only: 'yes'
          realm: kong
          introspection_endpoint: http://mykeycloak.com/auth/realms/experimental/protocol/openid-connect/token/introspect 
          discovery: http://mykeycloak.com/auth/realms/master/.well-known/openid-configuration