Coder Social home page Coder Social logo

asgardeo / asgardeo-tomcat-saml-agent Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 25.0 744 KB

SAML Agent for Tomcat using Java SAML SDK for Asgardio

License: Apache License 2.0

Java 59.41% HTML 12.06% Shell 17.29% Dockerfile 2.91% CSS 8.32%
hacktoberfest

asgardeo-tomcat-saml-agent's People

Contributors

chamathns avatar cnapagoda avatar darshanasbg avatar deshankoswatte avatar dinikasen avatar emswbandara avatar gayashanbc avatar godwinamila avatar hasinthaindrajee avatar isharak avatar jkaushalya avatar kanchanagodage avatar kasungayan avatar kayathiri4 avatar madumalt avatar madurangasiriwardena avatar maheshika avatar malithie avatar mefarazath avatar nilagini avatar nipunibhagya avatar omindu avatar piyarathnalakmali avatar pulasthi7 avatar rashmini avatar senthalan avatar thanujalk avatar thivi avatar vihanga-liyanage avatar wso2-jenkins-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asgardeo-tomcat-saml-agent's Issues

Add support for target page.

Describe the issue:

Currently, upon successful authentication, the SSO agent redirects the user to the page registered in the ACS URL (eg: app/home).

However, if a user tries to access another secured page (eg: app/myAccount) without having an authenticated session with the IdP, the user is first prompted for authentication. Then upon successful authentication, the user is redirected to the app/home where the user should have been redirected to the original page he tried to access; app/myAccount.

Expected behaviour

The Agent should keep track of the original page the user tried to access (target page), and redirect the user to the target page upon successful authentication.

Dockerize the sample app

Description

The sample app needs to be dockerized in order to facilitate convenient deployments.

Single Logout flow not working as expected.

Description:
After initiating an SLO request from a secondary application and then, refreshing the logged-in secured page (eg: home.jsp in the sample-app in tomcat-saml-agent) of the primary app does not redirect the user to a login page nor does it prompt the user for authentication. Instead a new logged in session would be created and the secured page would be accessible.

logout

Steps to reproduce:

  1. Configure two webapps with the WSO2-IS. In my testing, I configured the pickup-dispatch webapp (OIDC) and the sample-app (SAML).
  2. Enable Single Logout under the service provider configurations (Inbound Authentication Configuration -> SAML2 Web SSO Configuration) of the sample-app.
  3. Login from the pickup-dispatch app providing the user credentials.
  4. Open a new tab on the same browser and log in to the sample-app. (Should not be prompted for authentication in this step)
  5. After getting to the home page of both the applications, click on logout from the pickup-dispatch app.
  6. Verify if the user is logged out. (The user should be redirected to the log in page of the pickup-dispatch app.)
  7. Switch to the sample-app application, (The user should be on the home.jsp page of the sample-app), and hit refresh on browser.
  8. The home.jsp page of the sample-app would still be accessible.

Threadrace bug

Describe the issue:

SSOAgentConfig is singleton, so changing this object with requests should be synchronized or use copy of object. Concrete example of code is here:
https://github.com/asgardio/asgardio-tomcat-saml-agent/blob/master/io.asgardio.tomcat.saml.agent/src/main/java/io/asgardio/tomcat/saml/agent/SAML2SSOAgentFilter.java#L148-L151

After incorrect case variable ssoAgentConfig.getSAML2().isPassiveAuthn ends with value true a then all next logins will be passive.

I made pull request for this bug, that includes changes after code review.

How to reproduce:

I wrote test for this case https://github.com/boulik/tomcat-saml-agent-stressTest
Expected behavior:

--

Environment information (Please complete the following information; remove any unnecessary fields) :

  • Product Version: [IS 5.7.0]
  • OS: [Windows, Linux, Mac]
  • Browser: [Chrome, Firefox, Edge, Safari]
  • SDK Version: [0.1.18]
    --

Optional Fields

Related issues:

Suggested labels:

Cross protocol SLO is not working properly for SAML

Describe the issue:

Cross protocol SLO is not working properly for SAML tomact agent sample applictaion

When logout from the OIDC application which is SSO and SLO enabled, below behavior found

  1. Stay in same page when refresh is done from the SAML application for IDP initiated SSO in SAML application.
  2. Prompt the Login page when refresh is done from the SAML application for SP initiated SSO in SAML application.

Logout from the SAML application is not functioning properly in both cases.

How to reproduce:

1.Setup the sample SAML agent application
2. Setup OIDC Application in order to work the SSO
( SSO & SLO enabled, IDP initialed SSO & SLO enabled with back channel logout enabled both applications)
3. Logout from the OIDC application
4. behavior

  • Refresh the SAML application when SSO initiated by IDP, it will stay in same page without knowing back channel is logout.

  • Refresh the SAML application when SSO initaied by SP itself, then it will prompt Login page because of SAML2RequestID is null in [1] and send SSO request again to IS. This is always gives null even without logout is performed every refresh it calls the SSO request to IS.

Here, InResponseTo value not there in the IDP initialed SAML response while SAML response in SP initialed scenario has some value. Both case it doesn't fire /logout flow in the SAML2SSOAgentFilter instead always fire [2] condition

[1] https://github.com/asgardio/asgardio-java-saml-sdk/blob/master/io.asgardio.java.saml.sdk/src/main/java/io/asgardio/java/saml/sdk/SAML2SSOManager.java#L376
[2] https://github.com/asgardio/asgardio-tomcat-saml-agent/blob/master/io.asgardio.tomcat.saml.agent/src/main/java/io/asgardio/tomcat/saml/agent/SAML2SSOAgentFilter.java#L94
Expected behavior:

Environment information (Please complete the following information; remove any unnecessary fields) :

  • Product Version: [IS 5.10.0]
  • OS: [Linux,]
  • Browser: [Chrome]
  • SDK Version: [io.asgardio.tomcat.saml.agent:0.1.16 ]

Optional Fields

Related issues:

Suggested labels:

Server Error when key store properties are not included.

Describe the issue:
The following error prevents the web app from deploying if the keyStore related properties are not included in the .properties file.

org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [io.asgardeo.tomcat.saml.agent.SSOAgentContextEventListener]
        java.lang.NullPointerException
                at io.asgardeo.tomcat.saml.agent.SSOAgentContextEventListener.contextInitialized(SSOAgentContextEventListener.java:80)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4716)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1023)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
...

How to reproduce:

Remove the Keystore-related configurations from the properties file and deploy the web app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.