You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by babbarkrishan <kr...@paxcel.net> on 2015/05/28 13:01:22 UTC
Step by step guide for SSO implementation using Shiro
Hi All,
I am new to Apache Shiro. I know the basic concepts of SSO.
I need to create a POC (at my localhost using Tomcat) for SSO something
similar to mentioned at http://shiro.apache.org/cas.html
I am not sure how and where to start.
When I downloaded source code "shiro-root-1.2.3" I saw there are many sample
projects and cas is also there.
Kindly help me and let me know if there are any step by step instructions
for implementing SSO?
I could run web and spring projects using "mvn clean jetty:run" command and
"samples/quickstart" project using "mvn compile exec:java" command.
I could not find the way to run "cas" project.
Please let me know how to run existing cas project and use that in
web/spring projects?
Regards,
Krishan Babbar
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by jleleu <le...@gmail.com>.
Hi,
To ensure you log only once, you need some custom mechanism: check that the
username is not already in the current ticket registry: either you can
easily request your ticket registry by username or you need to save
somewhere the information of which username has logged in.
Maybe you can use the CAS addons for that:
https://github.com/Unicon/cas-addons/wiki
I think the question has already been asked on the CAS user mailing list.
Best regards,
Jérôme
2015-08-11 14:58 GMT+02:00 babbarkrishan [via Shiro User] <
ml-node+s582556n7580662h90@n2.nabble.com>:
> Thanks Jérôme,
>
> We are able to use Jasig CAS with our 2 applications as a client.
> One application is based upon Spring and other is Pentaho.
>
> These are working fine.
>
> Now, we got an another requirement of single session for a particular
> user.
> Means, if a user is logged in a browser and same user try to login again
> in another browser then destroy her older session and allow to login in new
> browser.
>
> Kindly suggest.
>
> Same question is asked by my teammate at
> http://stackoverflow.com/questions/31942043/jasig-cas-allow-only-one-session-per-user-account.
>
>
> Thanks in advance.
>
> Regards,
> Krishan
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580662.html
> To start a new topic under Shiro User, email
> ml-node+s582556n582556h4@n2.nabble.com
> To unsubscribe from Shiro User, click here
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=582556&code=bGVsZXVqQGdtYWlsLmNvbXw1ODI1NTZ8LTExNzY2MzcxMTY=>
> .
> NAML
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580663.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by babbarkrishan <kr...@paxcel.net>.
Thanks Jérôme,
We are able to use Jasig CAS with our 2 applications as a client.
One application is based upon Spring and other is Pentaho.
These are working fine.
Now, we got an another requirement of single session for a particular user.
Means, if a user is logged in a browser and same user try to login again in
another browser then destroy her older session and allow to login in new
browser.
Kindly suggest.
Same question is asked by my teammate at
http://stackoverflow.com/questions/31942043/jasig-cas-allow-only-one-session-per-user-account.
Thanks in advance.
Regards,
Krishan
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580662.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by jleleu <le...@gmail.com>.
Hi,
To delegate login to external identity providers, you must use the
case-server-support-pac4j module:
http://jasig.github.io/cas/4.0.x/integration/Delegate-Authentication.html
The demo: https://github.com/leleuj/cas-pac4j-oauth-demo
Thanks.
Best regards,
Jérôme
2015-06-01 9:52 GMT+02:00 babbarkrishan [via Shiro User] <
ml-node+s582556n7580563h21@n2.nabble.com>:
> Thanks Again,
>
> My next question is, I need to allow OAuth, Facebook login, Google+ Login
> and Form based login in my CAS server. Do "
> https://github.com/leleuj/cas-overlay-demo" will work? Is it allow to use
> on production? Or do i need to write everything by myself?
>
> Regards,
> Krishan
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580563.html
> To start a new topic under Shiro User, email
> ml-node+s582556n582556h4@n2.nabble.com
> To unsubscribe from Shiro User, click here
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=582556&code=bGVsZXVqQGdtYWlsLmNvbXw1ODI1NTZ8LTExNzY2MzcxMTY=>
> .
> NAML
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580564.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by babbarkrishan <kr...@paxcel.net>.
Thanks Again,
My next question is, I need to allow OAuth, Facebook login, Google+ Login
and Form based login in my CAS server. Do
"https://github.com/leleuj/cas-overlay-demo" will work? Is it allow to use
on production? Or do i need to write everything by myself?
Regards,
Krishan
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580563.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by jleleu <le...@gmail.com>.
Hi,
You just need to define two CAS services for your web applications:
https://github.com/leleuj/cas-overlay-demo/blob/master/cas-overlay-server-demo/src/main/webapp/WEB-INF/deployerConfigContext.xml#L152
.
The logout filter must be enabled in both web applications.
Best regards,
Jérôme
2015-05-29 11:15 GMT+02:00 babbarkrishan [via Shiro User] <
ml-node+s582556n7580558h66@n2.nabble.com>:
> Thanks Jérôme,
>
> These will really help me.
>
> Yesterday, I tried in another way.
>
> I used "https://github.com/leleuj/cas-overlay-demo" as a CAS server (on
> port 8080 Tomcat).
> I created 2 copies of web project from "shiro-root-1.2.3\samples"
> (Downloaded Apache Shiro Samples) and run them on different ports say 9080
> and 9081 (Jetty).
> Both connected with CAS server running at 8080 and those were working
> fine.
>
> Just 1 query, how to logout completely?
> Means if I logout from 1st instance, I should not be able to see protected
> contents on 2nd instance on refreshing the page. How to achieve it?
>
> Regards,
> Krishan
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580558.html
> To start a new topic under Shiro User, email
> ml-node+s582556n582556h4@n2.nabble.com
> To unsubscribe from Shiro User, click here
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=582556&code=bGVsZXVqQGdtYWlsLmNvbXw1ODI1NTZ8LTExNzY2MzcxMTY=>
> .
> NAML
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580559.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by babbarkrishan <kr...@paxcel.net>.
Thanks Jérôme,
These will really help me.
Yesterday, I tried in another way.
I used "https://github.com/leleuj/cas-overlay-demo" as a CAS server (on port
8080 Tomcat).
I created 2 copies of web project from "shiro-root-1.2.3\samples"
(Downloaded Apache Shiro Samples) and run them on different ports say 9080
and 9081 (Jetty).
Both connected with CAS server running at 8080 and those were working fine.
Just 1 query, how to logout completely?
Means if I logout from 1st instance, I should not be able to see protected
contents on 2nd instance on refreshing the page. How to achieve it?
Regards,
Krishan
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580558.html
Sent from the Shiro User mailing list archive at Nabble.com.
Re: Step by step guide for SSO implementation using Shiro
Posted by jleleu <le...@gmail.com>.
Hi,
I created a demo for the shiro-cas module:
https://github.com/leleuj/java-shiro-cas-client-demo.
If you want to use CAS and other providers, you might be interested by the
offical extension: https://github.com/bujiio/buji-pac4j and its demo:
https://github.com/pac4j/buji-pac4j-demo.
Best regards,
Jérôme
2015-05-28 13:01 GMT+02:00 babbarkrishan [via Shiro User] <
ml-node+s582556n7580556h4@n2.nabble.com>:
> Hi All,
>
> I am new to Apache Shiro. I know the basic concepts of SSO.
> I need to create a POC (at my localhost using Tomcat) for SSO something
> similar to mentioned at http://shiro.apache.org/cas.html
>
> I am not sure how and where to start.
>
> When I downloaded source code "shiro-root-1.2.3" I saw there are many
> sample projects and cas is also there.
>
> Kindly help me and let me know if there are any step by step instructions
> for implementing SSO?
>
> I could run web and spring projects using "mvn clean jetty:run" command
> and "samples/quickstart" project using "mvn compile exec:java" command.
>
> I could not find the way to run "cas" project.
>
> Please let me know how to run existing cas project and use that in
> web/spring projects?
>
>
> Regards,
> Krishan Babbar
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556.html
> To start a new topic under Shiro User, email
> ml-node+s582556n582556h4@n2.nabble.com
> To unsubscribe from Shiro User, click here
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=582556&code=bGVsZXVqQGdtYWlsLmNvbXw1ODI1NTZ8LTExNzY2MzcxMTY=>
> .
> NAML
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://shiro-user.582556.n2.nabble.com/Step-by-step-guide-for-SSO-implementation-using-Shiro-tp7580556p7580557.html
Sent from the Shiro User mailing list archive at Nabble.com.