*: load static clients from config file

This commit is contained in:
Eric Chiang
2016-08-05 09:50:22 -07:00
parent 725a94214a
commit 53d1be4a87
7 changed files with 101 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
@@ -125,7 +126,7 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) {
for id := range s.connectors {
connectorInfos[i] = connectorInfo{
DisplayName: id,
URL: s.absPath("/auth", id) + "?state=" + state,
URL: s.absPath("/auth", id),
}
i++
}
@@ -224,6 +225,9 @@ func (s *Server) handleConnectorCallback(w http.ResponseWriter, r *http.Request)
}
func (s *Server) finalizeLogin(identity connector.Identity, authReqID, connectorID string, conn connector.Connector) (string, error) {
if authReqID == "" {
return "", errors.New("no auth request ID passed")
}
claims := storage.Claims{
UserID: identity.UserID,
Username: identity.Username,