<@U04UQ68083H> show me an example of an Authentica...
# ory-copilot
c
@chilly-king-10285 show me an example of an AuthenticationSession value
c
A message from kapa.ai
Sure, here is an example of an
AuthenticationSession
value:
Copy code
go type AuthenticationSession struct {     Subject      string     Extra        map[string]interface{}     Header       http.Header     MatchContext MatchContext   }      type MatchContext struct {     RegexpCaptureGroups []string     URL                 *url.URL     Method              string     Header              http.Header   }
In this structure,
Subject
is a string that represents the subject of the session.
Extra
is a map that can contain any additional data related to the session.
Header
is an HTTP header associated with the session.
MatchContext
is another struct that contains information about the match context, including regular expression capture groups, the URL, the method, and the HTTP header. You can find more details about this in the [Ory documentation](https://www.ory.sh/docs/oathkeeper/pipeline#session).
c
@chilly-king-10285 I want it in json with placeholder the one that I can use in authorizer remote_json payload
c
A message from kapa.ai
Sure, here is an example of how you can use placeholders in the
remote_json
authorizer payload, which are derived from the `AuthenticationSession`:
Copy code
json {   "subject": "{{ print .Subject }}",   "resource": "{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}" }
In this JSON payload,
{{ print .Subject }}
is a placeholder for the
Subject
field of the
AuthenticationSession
, and
{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}
is a placeholder for the first element of the
RegexpCaptureGroups
field of the
MatchContext
within the
AuthenticationSession
. You can find more details about this in the [Ory documentation](https://www.ory.sh/docs/oathkeeper/pipeline/authz#remote_json-configuration).