Oauth2 sample client code

26 views
Skip to first unread message

Maxwell, Gary

unread,
May 14, 2019, 11:38:38 AM5/14/19
to cas-...@apereo.org

Hi all,

 

Does anyone have an example of client code to authenticate to CAS 5 via OAUTH2?

 

I perform the following “GET”:

https://cas.server/cas/oauth2.0/authorize?response_type=code&state=&client_id=??????&scope=&redirect_uri=https%3A%2F%2Flocalhost%2FtestOauth%2My")

 

I am redirected and successfully login to cas however it then sends me to “cas.server/”. It does not redirect me to the redirect_uri.

 

Any Ideas?

 

-Gary

Andy Ng

unread,
May 15, 2019, 12:22:23 AM5/15/19
to CAS Community
Hi Gary,

I can use the OAuth2, my path is like this:

response_type=code&
client_id=MY_CLIENT_ID&
state=nj27b3nc0p

And it can successfully get back to https://www.example.com/oauth?code=XXXX

Which version of CAS 5 are you using? CAS 5.3? Anyway most of the CAS 5 version should work. 

See if you remove the empty scope and state and see if that make you login redirect flow correctly.

Cheers!
- Andy

Reply all
Reply to author
Forward
0 new messages