| 85 | } |
| 86 | |
| 87 | func (i *IdentityManager) Middleware(next http.Handler) http.Handler { |
| 88 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 89 | authentication_info := i.makeAuthenticationInfoFromRequest(r) |
| 90 | newContext := i.ContextUserManager.WithAuthenticationInfo(r.Context(), authentication_info) |
| 91 | r = r.WithContext(newContext) |
| 92 | next.ServeHTTP(w, r) |
| 93 | }) |
| 94 | } |
| 95 | |
| 96 | func (i *IdentityManager) Authenticate(w http.ResponseWriter, r *http.Request, userId string, organizationUserId string) { |
| 97 | i.Persister.Rotate(w, r) |