| 106 | } |
| 107 | |
| 108 | func (i *IdentityManager) AuthenticateContext(c context.Context, userId string, organzationUserId string) { |
| 109 | w := GetResponseWriter(c) |
| 110 | r := GetRequest(c) |
| 111 | // Set authentication info on the session for next requests |
| 112 | i.Authenticate(w, r, userId, organzationUserId) |
| 113 | user := i.IdentityRepo.GetUserById(userId) |
| 114 | orgUser := i.IdentityRepo.GetOrganizationUserById(organzationUserId) |
| 115 | // Set authentication info on the context for this request |
| 116 | i.ContextUserManager.SetAuthenticationInfo(c, &identity.AuthenticationInfo{ |
| 117 | AuthenticatedUser: &identity.AuthenticatedUser{User: user}, |
| 118 | AuthorizedUser: &identity.AuthorizedUser{OrganizationUser: orgUser}, |
| 119 | }) |
| 120 | } |
| 121 | |
| 122 | func (i *IdentityManager) LogoutContext(c context.Context) { |
| 123 | authContext := i.ContextUserManager.GetAuthenticationInfo(c) |