Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
854b7672
Commit
854b7672
authored
Jul 25, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: update handlers to include issuer url in path
parent
1e0ee1e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
server.go
server/server.go
+21
-15
ldap-login.html
static/html/ldap-login.html
+1
-1
local-login.html
static/html/local-login.html
+1
-1
No files found.
server/server.go
View file @
854b7672
...
...
@@ -214,41 +214,47 @@ func (s *Server) HTTPHandler() http.Handler {
clock
:=
clockwork
.
NewRealClock
()
mux
:=
http
.
NewServeMux
()
mux
.
HandleFunc
(
httpPathDiscovery
,
handleDiscoveryFunc
(
s
.
ProviderConfig
()))
mux
.
HandleFunc
(
httpPathAuth
,
handleAuthFunc
(
s
,
s
.
Connectors
,
s
.
LoginTemplate
,
s
.
EnableRegistration
))
mux
.
HandleFunc
(
httpPathOOB
,
handleOOBFunc
(
s
,
s
.
OOBTemplate
))
mux
.
HandleFunc
(
httpPathToken
,
handleTokenFunc
(
s
))
mux
.
HandleFunc
(
httpPathKeys
,
handleKeysFunc
(
s
.
KeyManager
,
clock
))
mux
.
Handle
(
httpPathHealth
,
makeHealthHandler
(
checks
))
handle
:=
func
(
urlPath
string
,
h
http
.
Handler
)
{
mux
.
Handle
(
path
.
Join
(
s
.
IssuerURL
.
Path
,
urlPath
),
h
)
}
handleFunc
:=
func
(
urlPath
string
,
hf
http
.
HandlerFunc
)
{
handle
(
urlPath
,
hf
)
}
handleFunc
(
httpPathDiscovery
,
handleDiscoveryFunc
(
s
.
ProviderConfig
()))
handleFunc
(
httpPathAuth
,
handleAuthFunc
(
s
,
s
.
Connectors
,
s
.
LoginTemplate
,
s
.
EnableRegistration
))
handleFunc
(
httpPathOOB
,
handleOOBFunc
(
s
,
s
.
OOBTemplate
))
handleFunc
(
httpPathToken
,
handleTokenFunc
(
s
))
handleFunc
(
httpPathKeys
,
handleKeysFunc
(
s
.
KeyManager
,
clock
))
handle
(
httpPathHealth
,
makeHealthHandler
(
checks
))
if
s
.
EnableRegistration
{
mux
.
H
andleFunc
(
httpPathRegister
,
handleRegisterFunc
(
s
,
s
.
RegisterTemplate
))
h
andleFunc
(
httpPathRegister
,
handleRegisterFunc
(
s
,
s
.
RegisterTemplate
))
}
mux
.
H
andleFunc
(
httpPathEmailVerify
,
handleEmailVerifyFunc
(
s
.
VerifyEmailTemplate
,
h
andleFunc
(
httpPathEmailVerify
,
handleEmailVerifyFunc
(
s
.
VerifyEmailTemplate
,
s
.
IssuerURL
,
s
.
KeyManager
.
PublicKeys
,
s
.
UserManager
))
mux
.
H
andle
(
httpPathVerifyEmailResend
,
s
.
NewClientTokenAuthHandler
(
handleVerifyEmailResendFunc
(
s
.
IssuerURL
,
h
andle
(
httpPathVerifyEmailResend
,
s
.
NewClientTokenAuthHandler
(
handleVerifyEmailResendFunc
(
s
.
IssuerURL
,
s
.
KeyManager
.
PublicKeys
,
s
.
UserEmailer
,
s
.
UserRepo
,
s
.
ClientManager
)))
mux
.
H
andle
(
httpPathSendResetPassword
,
&
SendResetPasswordEmailHandler
{
h
andle
(
httpPathSendResetPassword
,
&
SendResetPasswordEmailHandler
{
tpl
:
s
.
SendResetPasswordEmailTemplate
,
emailer
:
s
.
UserEmailer
,
sm
:
s
.
SessionManager
,
cm
:
s
.
ClientManager
,
})
mux
.
H
andle
(
httpPathResetPassword
,
&
ResetPasswordHandler
{
h
andle
(
httpPathResetPassword
,
&
ResetPasswordHandler
{
tpl
:
s
.
ResetPasswordTemplate
,
issuerURL
:
s
.
IssuerURL
,
um
:
s
.
UserManager
,
keysFunc
:
s
.
KeyManager
.
PublicKeys
,
})
mux
.
H
andle
(
httpPathAcceptInvitation
,
&
InvitationHandler
{
h
andle
(
httpPathAcceptInvitation
,
&
InvitationHandler
{
passwordResetURL
:
s
.
absURL
(
httpPathResetPassword
),
issuerURL
:
s
.
IssuerURL
,
um
:
s
.
UserManager
,
...
...
@@ -258,10 +264,10 @@ func (s *Server) HTTPHandler() http.Handler {
})
if
s
.
EnableClientRegistration
{
mux
.
H
andleFunc
(
httpPathClientRegistration
,
s
.
handleClientRegistration
)
h
andleFunc
(
httpPathClientRegistration
,
s
.
handleClientRegistration
)
}
mux
.
H
andleFunc
(
httpPathDebugVars
,
health
.
ExpvarHandler
)
h
andleFunc
(
httpPathDebugVars
,
health
.
ExpvarHandler
)
pcfg
:=
s
.
ProviderConfig
()
for
_
,
idpc
:=
range
s
.
Connectors
{
...
...
@@ -280,7 +286,7 @@ func (s *Server) HTTPHandler() http.Handler {
usersAPI
:=
usersapi
.
NewUsersAPI
(
s
.
UserManager
,
s
.
ClientManager
,
s
.
RefreshTokenRepo
,
s
.
UserEmailer
,
s
.
localConnectorID
)
handler
:=
NewUserMgmtServer
(
usersAPI
,
s
.
JWTVerifierFactory
(),
s
.
UserManager
,
s
.
ClientManager
)
.
HTTPHandler
()
mux
.
H
andle
(
apiBasePath
+
"/"
,
handler
)
h
andle
(
apiBasePath
+
"/"
,
handler
)
return
http
.
Handler
(
mux
)
}
...
...
static/html/ldap-login.html
View file @
854b7672
...
...
@@ -2,7 +2,7 @@
<div
class=
"panel"
>
<h2
class=
"heading"
>
Log in to Your Account
</h2>
<form
method=
"post"
action=
"{{
.PostURL | absPath
}}"
>
<form
method=
"post"
action=
"{{
.PostURL
}}"
>
<div
class=
"form-row"
>
LDAP
<div
class=
"input-desc"
>
...
...
static/html/local-login.html
View file @
854b7672
...
...
@@ -2,7 +2,7 @@
<div
class=
"panel"
>
<h2
class=
"heading"
>
Log in to Your Account
</h2>
<form
method=
"post"
action=
"{{
.PostURL | absPath
}}"
>
<form
method=
"post"
action=
"{{
.PostURL
}}"
>
<div
class=
"form-row"
>
<div
class=
"input-desc"
>
<label
for=
"userid"
>
Email Address
</label>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment