Extract clientID to command line client
This commit is contained in:
parent
d62afd7738
commit
9e7448c53b
|
|
@ -109,9 +109,10 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clientID := "https://p83.nl/microsub-client"
|
||||||
scope := "read follow mute block channels"
|
scope := "read follow mute block channels"
|
||||||
|
|
||||||
token, err := indieauth.Authorize(me, endpoints, scope)
|
token, err := indieauth.Authorize(me, endpoints, clientID, scope)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ func GetEndpoints(me *url.URL) (Endpoints, error) {
|
||||||
return endpoints, nil
|
return endpoints, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Authorize(me *url.URL, endpoints Endpoints, scope string) (TokenResponse, error) {
|
func Authorize(me *url.URL, endpoints Endpoints, clientID, scope string) (TokenResponse, error) {
|
||||||
var tokenResponse TokenResponse
|
var tokenResponse TokenResponse
|
||||||
|
|
||||||
authURL, err := url.Parse(endpoints.AuthorizationEndpoint)
|
authURL, err := url.Parse(endpoints.AuthorizationEndpoint)
|
||||||
|
|
@ -68,7 +68,6 @@ func Authorize(me *url.URL, endpoints Endpoints, scope string) (TokenResponse, e
|
||||||
return tokenResponse, err
|
return tokenResponse, err
|
||||||
}
|
}
|
||||||
|
|
||||||
clientID := "https://p83.nl/microsub-client"
|
|
||||||
local := ln.Addr().String()
|
local := ln.Addr().String()
|
||||||
redirectURI := fmt.Sprintf("http://%s/", local)
|
redirectURI := fmt.Sprintf("http://%s/", local)
|
||||||
state := "12345344"
|
state := "12345344"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user