[cas-user] google,Yahoo and LinkedIn config for CAS 4.

101 views
Skip to first unread message

Sashika

unread,
Jan 13, 2014, 12:00:23 AM1/13/14
to cas-...@lists.jasig.org
For 3.5 I can find the config for Google, Yahoo and LinkedIn through the below url

But for CAS version 4 I cant find what are the config for these three logins. Can anyone please show me the correct configs or a relevant link. 

Thanks.
-- 
You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Jérôme LELEU

unread,
Jan 13, 2014, 8:53:22 AM1/13/14
to cas-...@lists.jasig.org
Hi,

The documentation for OAuth client support in CAS 4.0 is here: https://wiki.jasig.org/pages/viewpage.action?pageId=56164890.
It's pretty similar between 3.5 and 4.0, except that the classes has been renamed from *Provider to *Client. Here is the Javadoc for clients: http://www.pac4j.org/apidocs/pac4j/.
Best regards,
Jérôme



2014/1/13 Sashika <sash...@gmail.com>
For 3.5 I can find the config for Google, Yahoo and LinkedIn through the below url

But for CAS version 4 I cant find what are the config for these three logins. Can anyone please show me the correct configs or a relevant link. 

Thanks.
-- 
You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Sashika

unread,
Jan 17, 2014, 1:53:52 AM1/17/14
to cas-...@lists.jasig.org
After twitter changing their api access to SSL/TLS on 14th Jan, CAS cannot login through Twitter. The exception is as below.

StandardWrapperValve[cas]: PWC1406: Servlet.service() for servlet cas threw exception org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'Failed to exchange tokens' at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:41) at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:27) at org.scribe.oauth.ProxyOAuth10aServiceImpl.getAccessToken(ProxyOAuth10aServiceImpl.java:103) at org.pac4j.oauth.client.BaseOAuth10Client.getAccessToken(BaseOAuth10Client.java:110) at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:163) at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:44) at org.pac4j.core.client.BaseClient.getUserProfile(BaseClient.java:147) at org.pac4j.core.client.BaseClient.getUserProfile(BaseClient.java:52) at org.jasig.cas.support.pac4j.authentication.handler.support.ClientAuthenticationHandler.doAuthentication(ClientAuthenticationHandler.java:80) at org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate(AbstractPreAndPostProcessingAuthenticationHandler.java:78) at org.jasig.cas.authentication.PolicyBasedAuthenticationManager.authenticateInternal(PolicyBasedAuthenticationManager.java:211) at org.jasig.cas.authentication.PolicyBasedAuthenticationManager.authenticate(PolicyBasedAuthenticationManager.java:143) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at 

------------------------
------------------------
StandardWrapperValve[cas]: PWC1406: Servlet.service() for servlet cas threw exception java.lang.IllegalArgumentException: Cannot get String from a null object at org.scribe.utils.Preconditions.check(Preconditions.java:82) at org.scribe.utils.Preconditions.checkNotNull(Preconditions.java:29) at org.scribe.utils.StreamUtils.getStreamContents(StreamUtils.java:20) at org.scribe.model.Response.parseBodyContents(Response.java:41) at org.scribe.model.Response.getBody(Response.java:67) at org.pac4j.oauth.client.BaseOAuthClient.sendRequestForData(BaseOAuthClient.java:235) at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfileFromToken(BaseOAuthClient.java:201) at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:164) at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:44) at org.pac4j.core.client.BaseClient.getUserProfile(BaseClient.java:147) at org.pac4j.core.client.BaseClient.getUserProfile(BaseClient.java:52) at org.jasig.cas.support.pac4j.authentication.handler.support.ClientAuthenticationHandler.doAuthentication(ClientAuthenticationHandler.java:80) at org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate(AbstractPreAndPostProcessingAuthenticationHandler.java:78) at org.jasig.cas.authentication.PolicyBasedAuthenticationManager.authenticateInternal(PolicyBasedAuthenticationManager.java:211) at org.jasig.cas.authentication.PolicyBasedAuthenticationManager.authenticate(PolicyBasedAuthenticationManager.java:143) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at 


On Mon, Jan 13, 2014 at 7:23 PM, Jérôme LELEU <lel...@gmail.com> wrote:
Hi,

The documentation for OAuth client support in CAS 4.0 is here: https://wiki.jasig.org/pages/viewpage.action?pageId=56164890.
It's pretty similar between 3.5 and 4.0, except that the classes has been renamed from *Provider to *Client. Here is the Javadoc for clients: http://www.pac4j.org/apidocs/pac4j/.
Best regards,
Jérôme



2014/1/13 Sashika <sash...@gmail.com>
For 3.5 I can find the config for Google, Yahoo and LinkedIn through the below url

But for CAS version 4 I cant find what are the config for these three logins. Can anyone please show me the correct configs or a relevant link. 

Thanks.
-- 
You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to cas-...@lists.jasig.org as: sash...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Jérôme LELEU

unread,
Jan 17, 2014, 9:31:57 AM1/17/14
to cas-...@lists.jasig.org
Hi,

Indeed. The problem has been fixed both on pac4j 1.4.2-SNAPSHOT (bug fixes version) and pac4j 1.5.0-SNAPSHOT (next version).
It should work using pac4j 1.4.2-SNAPSHOT instead of pac4j 1.4.1 which is automatically retrieved with the CAS server 4.0.
Best regards,
Jérôme



2014/1/17 Sashika <sash...@gmail.com>

Sashika

unread,
Jan 20, 2014, 2:03:17 AM1/20/14
to cas-...@lists.jasig.org
Thanks, it works perfectly now.  
Once the CAS is authenticated through facebook/twitter is there a way which we can identify from which social network the user logged in? Because in the oauth2.0/profile JSON we do not have that information.

Thanks

Jérôme LELEU

unread,
Jan 20, 2014, 4:32:42 AM1/20/14
to cas-...@lists.jasig.org
Sure.

Inside the CAS server, one authentication attribute stores the provider used for authentication: https://github.com/Jasig/cas/blob/master/cas-server-support-pac4j/src/main/java/org/jasig/cas/support/pac4j/authentication/ClientAuthenticationMetaDataPopulator.java#L47.

Moreover, the principal id is automatically build according to the provider used for authentication and the provider can be retrieved using the ```ProfileHelper``` class: https://github.com/leleuj/pac4j/blob/master/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java#L41.

Everything is explained in the documentation: https://wiki.jasig.org/pages/viewpage.action?pageId=56164890.

Best regards,
Jérôme



2014/1/20 Sashika <sash...@gmail.com>
Reply all
Reply to author
Forward
0 new messages