Refactor previous COOPGO Identity service - Initial commit

This commit is contained in:
2022-08-02 12:26:28 +02:00
commit 3e93e6593d
41 changed files with 9026 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package op
import (
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/ory/fosite"
)
func (op *OIDCHandler) IntrospectionEndpoint(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
namespace := mux.Vars(r)["namespace"]
oauth2Provider := op.NamespaceProviders[namespace]
ctx := r.Context()
mySessionData := new(fosite.DefaultSession)
ir, err := oauth2Provider.NewIntrospectionRequest(ctx, r, mySessionData)
if err != nil {
log.Printf("Error occurred in NewIntrospectionRequest: %+v", err)
oauth2Provider.WriteIntrospectionError(w, err)
return
}
oauth2Provider.WriteIntrospectionResponse(w, ir)
}