Add client authentication
This commit is contained in:
parent
362abaf813
commit
2eaa30305b
@ -39,10 +39,12 @@ func mapToQuery(variables map[string]string) (output string) {
|
||||
}
|
||||
|
||||
func (c *PalAuthIAMClient) buildURL(path string, query map[string]string) string {
|
||||
return fmt.Sprintf("%s%s?%s", c.baseURL, path, mapToQuery(query))
|
||||
return fmt.Sprintf("%s/%s%s?%s", c.baseURL, c.clientId, path, mapToQuery(query))
|
||||
}
|
||||
|
||||
func (c *PalAuthIAMClient) runRequest(req *http.Request, mapTo interface{}) error {
|
||||
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.clientSecret))
|
||||
|
||||
res, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
return fmt.Errorf("making request: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user