Skip to content

Commit

Permalink
Decorate friendly name in case of OCM users
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Feb 28, 2023
1 parent bbe2696 commit f4a38af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/app/provider/wopi/wopi.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
}
if u.Id.Type == userpb.UserType_USER_TYPE_LIGHTWEIGHT || u.Id.Type == userpb.UserType_USER_TYPE_FEDERATED {
q.Add("userid", resource.Owner.OpaqueId+"@"+resource.Owner.Idp)
if !strings.Contains(u.DisplayName, "(") {
// the display name was not decorated with `(domain)` by the auth provider,
// assume this is an OCM user and append the corresponding Idp
u.DisplayName = u.DisplayName + "@" + u.Id.Idp
}
} else {
q.Add("userid", u.Id.OpaqueId+"@"+u.Id.Idp)
}
Expand Down

0 comments on commit f4a38af

Please sign in to comment.