mesosphere / traefik-forward-auth

218 stars 47 forks source link

Pass list of Scopes as env variable #59

Closed r2ronoha closed 2 years ago

r2ronoha commented 2 years ago

At the moment the SCOPE env variable is a single string. Would it be possible to update it so we can pass multiple scopes that will be consumed as an array?

ammmze commented 2 years ago

I just tested this, but you can just use a space delimited string in the SCOPE env var (here is what i just set in mine SCOPE: openid email profile groups audience:server:client_id:kubernetes). Despite the resulting scope being different here, the scope that is passed to the openid provider is still the same. I'm sure that somewhere internally the array of scopes is just joined with a space delimiter, so in effect these are the same:

['openid', 'email', 'profile', 'groups'].join(' ') // "openid email profile groups"

vs

['openid email profile groups'].join(' ') // "openid email profile groups"