Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

I successfully can get the token with casdoorsdk.GetOAuthToken() but when i try to call ParseJwtToken(token.AccessToken) then i get an error I do it as mentioned in github:
token, err := casdoorsdk.GetOAuthToken(code, state)
if err != nil {
panic(err)
}

claims, err := casdoorsdk.ParseJwtToken(token.AccessToken)
if err != nil {
panic(err)
}

2views
2users
1 minread

What does it mean when i try to parse JWT token then i get the error message invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key

Sorry for not being clear enough. I try the code from the docs but still same issue. Following code:package main

fmt.Println(claims)

}

If any example git repo doesn't work, report bug on it

Okay, but how to do the import of the public cert for the casdoor sdk. Is it enough to just save it as a String?

create new cert and use the generated cert

Don't replace it with your own value if you don't know what you are doing

1 / 11
Dec 2023