Skip to content

Commit

Permalink
Include identities that have standard attributes in oidc.jwt.pre_create
Browse files Browse the repository at this point in the history
#4653

ref DEV-1685
  • Loading branch information
tung2744 authored Aug 26, 2024
2 parents eabdc4d + 8dff648 commit 4ca04a8
Show file tree
Hide file tree
Showing 12 changed files with 816 additions and 58 deletions.
3 changes: 3 additions & 0 deletions docs/specs/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Use this event to add custom fields to the JWT access token.
{
"payload": {
"user": { /* ... */ },
"identities": [ ],
"jwt": {
"payload": {
"iss": "issuer",
Expand All @@ -192,6 +193,8 @@ Use this event to add custom fields to the JWT access token.
}
```

- `identities`: This contain all Login ID identities, OAuth identities, or LDAP identities that the user has.

### Non-blocking Events

- [user.created](#usercreated)
Expand Down
2 changes: 2 additions & 0 deletions pkg/admin/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pkg/api/event/blocking/oidc_jwt_pre_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ type OIDCJWT struct {
}

type OIDCJWTPreCreateBlockingEventPayload struct {
UserRef model.UserRef `json:"-" resolve:"user"`
UserModel model.User `json:"user"`
JWT OIDCJWT `json:"jwt"`
UserRef model.UserRef `json:"-" resolve:"user"`
UserModel model.User `json:"user"`
Identities []model.Identity `json:"identities"`
JWT OIDCJWT `json:"jwt"`
}

func (e *OIDCJWTPreCreateBlockingEventPayload) BlockingEventType() event.Type {
Expand Down
Loading

0 comments on commit 4ca04a8

Please sign in to comment.