Skip to content

Passing additional fields through the user service flows that aren't stored in the kratos db but can be used on the webhooks #2036

Answered by Benehiko
MilesNorton asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MilesNorton,

Yes, you can pass along headers, URL parameters and identity traits. Of course in your case, you would probably want to opt for using URL parameters.

To get this right you can use the provided ctx variable inside of your jssonet file. Here is an excerpt of what Kratos injects for you:

templateContext struct {
	Flow           flow.Flow          `json:"flow"`
	RequestHeaders http.Header        `json:"request_headers"`
	RequestMethod  string             `json:"request_method"`
	RequestUrl     string             `json:"request_url"`
	Identity       *identity.Identity `json:"identity"`
}

source

func (e *WebHook) ExecutePostRegistrationPostPersistHook(_ http.ResponseWriter, req *

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MilesNorton
Comment options

@MilesNorton
Comment options

Answer selected by MilesNorton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants