Hey guys, im trying to access the exposed casbin API's from casdoor but its just giving me a 403 Forbidden error although i have the right client id and secret for the request. Anything im missing?
reproduce it in the demo site: https://demo.casdoor.com/ , send here the example request
unfortunately still 403 my request looks like this:
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://demo.casdoor.com/api/get-all-objects", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Basic dd48c1a083b0c3cf4635 d85a6900eaccaeddf1b9ff28f973021be19fbd0f")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", resp.Status)
fmt.Printf("%s\n", bodyText)
}
Join the conversation
Sign up to reply, like and follow topics.
Suggested Topics
Want to read more? Browse other topics in Casdoor or view latest topics.
