[CAS 5.2.x] [OAuth] [Theme] How to make custom theme for OAuth sp

104 views
Skip to first unread message

Andy Ng

unread,
Feb 27, 2018, 10:01:07 PM2/27/18
to CAS Community
Hi all,

I am using CAS 5.2.x, and using OAuth for one service provider. The provider now would like to have a custom theme.

I thought I can just do this:

{
  "@class" : "org.apereo.cas.support.oauth.services.OAuthRegisteredService",
  "clientId": "OAuthApp",
  "clientSecret": "xxxxxxxxxxxxxx",
  "serviceId" : "^http://www.example.com/sp.*",
  "name" : "OAuthApp",
  "id" : 1000,
  "evaluationOrder" : 1000,
  "supportedResponseTypes" : [ "java.util.HashSet", [ "code" ] ],
  "supportedGrantTypes" : [ "java.util.HashSet",  [ "authorization_code" , "refresh_token"] ],
  "theme" : "awesome_theme"
}



However it seems that the service the returned service is the below:

client_name=XXXXXXX&
client_id=OAuthApp&
response_type=code


So the theme will not load. So my question is, is it possible for me to make custom theme for my OAuth SP provider?

Thanks in advance!

- Andy

Man H

unread,
Feb 27, 2018, 10:26:24 PM2/27/18
to cas-...@apereo.org
Try to.load that theme on a regular service, that is non oauth
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/3fa4db3b-f7e5-4751-8ba6-f3ee872f0f16%40apereo.org.

Andy Ng

unread,
Feb 27, 2018, 10:40:01 PM2/27/18
to CAS Community
Thanks Manfedo,

Do you mean that I should:
- Redirect user to login using Non Oauth Service first (with theme)
- Then redirect user to login using Oauth Service for actual Oauth login

Am I correct?

I would prefer not to do the above, since that mean the service provider need to change their code, but if needed I think the above is still feasible, thanks Manfedo.

I would like to see if there are a solution that, to not use non oauth login first. Thanks.

-Andy
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

Man H

unread,
Feb 27, 2018, 10:44:56 PM2/27/18
to cas-...@apereo.org
Cant you just build a simple webapp with index.html
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/66302352-d0d5-40fe-803e-5d01101a4873%40apereo.org.

Man H

unread,
Feb 27, 2018, 10:55:23 PM2/27/18
to cas-...@apereo.org
 open browser developper tool to see if itheme gets loaded
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/66302352-d0d5-40fe-803e-5d01101a4873%40apereo.org.

Andy Ng

unread,
Feb 27, 2018, 11:00:59 PM2/27/18
to CAS Community
Hi Manfredo,

I have the custom theme loaded no problem without oauth, is just that when I do it with oauth, setting the theme seems like a difficult task.

-Andy

Man H

unread,
Feb 28, 2018, 8:07:58 AM2/28/18
to cas-...@apereo.org
Try with 


client_name=XXXXXXX&
client_id=OAuthApp&
response_type=code


as serviceId
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/34df67cc-57aa-436a-90ef-be8643a385fa%40apereo.org.

Andy Ng

unread,
Feb 28, 2018, 11:00:36 PM2/28/18
to CAS Community
Hi Manfredo,

Thank you for this suggestion, but what if I need to change my site url, or the refirect_uri, or the client_name changed?

This method seems like too hard code, but I will use it if no other choice.

Thanks you!
Try with 


Reply all
Reply to author
Forward
0 new messages