Skip to content

Commit e45c3c1

Browse files
committed
Dump request works.
1 parent a95ae8a commit e45c3c1

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

example/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ var (
2626
Scopes: []string{"all"},
2727
RedirectURL: "http://localhost:9094/oauth2",
2828
Endpoint: oauth2.Endpoint{
29-
AuthURL: authServerURL + "/authorize",
30-
TokenURL: authServerURL + "/token",
29+
AuthURL: authServerURL + "/oauth/authorize",
30+
TokenURL: authServerURL + "/oauth/token",
3131
},
3232
}
3333
globalToken *oauth2.Token // Non-concurrent security

example/server/server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func main() {
8383
http.HandleFunc("/login", loginHandler)
8484
http.HandleFunc("/auth", authHandler)
8585

86-
http.HandleFunc("/authorize", func(w http.ResponseWriter, r *http.Request) {
86+
http.HandleFunc("/oauth/authorize", func(w http.ResponseWriter, r *http.Request) {
8787
if dumpvar {
8888
dumpRequest(os.Stdout, "authorize", r)
8989
}
@@ -109,7 +109,7 @@ func main() {
109109
}
110110
})
111111

112-
http.HandleFunc("/token", func(w http.ResponseWriter, r *http.Request) {
112+
http.HandleFunc("/oauth/token", func(w http.ResponseWriter, r *http.Request) {
113113
if dumpvar {
114114
_ = dumpRequest(os.Stdout, "token", r) // Ignore the error
115115
}
@@ -141,6 +141,8 @@ func main() {
141141
})
142142

143143
log.Printf("Server is running at %d port.\n", portvar)
144+
log.Printf("Point your OAuth client Auth endpoint to %s:%d%s", "http://localhost", portvar, "/oauth/authorize")
145+
log.Printf("Point your OAuth client Token endpoint to %s:%d%s", "http://localhost", portvar, "/oauth/token")
144146
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d",portvar), nil))
145147
}
146148

example/server/static/auth.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<body>
1515
<div class="container">
1616
<div class="jumbotron">
17-
<form action="/authorize" method="POST">
17+
<form action="/oauth/authorize" method="POST">
1818
<h1>Authorize</h1>
1919
<p>The client would like to perform actions on your behalf.</p>
2020
<p>

0 commit comments

Comments
 (0)