GithubHelp home page GithubHelp logo

jira-saml's People

Contributors

bcopeland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jira-saml's Issues

java.lang.NullPointerException: org.opensaml.xml.signature.SignatureValidator.buildSignature

According to the SAML specification it's not mandatory to have the "SessionOnOrAfter" attribute within the "AuthnStatement" though the plugin code checks for that. Add it by modifying the buildSAMLAssertion method in ResponseBuilder class.

java.lang.NullPointerException
org.opensaml.xml.signature.SignatureValidator.buildSignature(SignatureValidator.java:92)
org.opensaml.xml.signature.SignatureValidator.validate(SignatureValidator.java:56)
com.lastpass.saml.SAMLClient.validate(SAMLClient.java:171)
com.lastpass.saml.SAMLClient.validateResponse(SAMLClient.java:429)
com.lastpass.jira.SAMLAuthenticator.getUser(SAMLAuthenticator.java:195)

Windows support

Hello. Are there any plans to make an installer available for JIRA users that self-host on Windows? Perhaps a powershell script?

Thanks, Andrew.

Incorrect SSO URL construction

The SSO URL constructor assumes the SSO base URL has no query. Patch below:

diff --git a/src/com/lastpass/jira/SAMLAuthenticator.java b/src/com/lastpass/jira/SAMLAuthenticator.java
index d2aa6ee..251deb5 100644
--- a/src/com/lastpass/jira/SAMLAuthenticator.java
+++ b/src/com/lastpass/jira/SAMLAuthenticator.java
@@ -128,8 +128,11 @@ public class SAMLAuthenticator extends JiraSeraphAuthenticator
         try {
             String authrequest = client.generateAuthnRequest(requestId);
             String url = client.getIdPConfig().getLoginUrl();
-            url = url +
-                "?SAMLRequest=" + URLEncoder.encode(authrequest, "UTF-8");
+            String sep = "?";
+            if (url.indexOf("?") > -1)
+                sep = "&";
+            url = url + sep +
+                "SAMLRequest=" + URLEncoder.encode(authrequest, "UTF-8");

             if (relayState != null)
                 url += "&RelayState=" + URLEncoder.encode(relayState, "UTF-8");

SAMLAuthenticator.generatePassword(...) does not use same probability for all chars

It appears SAMLAuthenticator.generatePassword(int) does not use the same probability for all chars:

char[] chars =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()".toCharArray();
byte[] bytes = new byte[len];
char[] pw = new char[len];
new SecureRandom().nextBytes(bytes);
for (i=0; i < bytes.length; i++) {
int randval = bytes[i] & 0xff;
pw[i] = chars[randval % chars.length];
}
return String.valueOf(pw);

There are 72 chars but a char is picked using effectively random(0, 255) % 72. Therefore the first 40 (= 256 % 72) chars are picked with a probability of 4/7, while the remaining 32 chars are picked with a probability of 3/7.

Though this is likely not that dramatic.

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.