<commit_before>Spring Security BrowserID Login
===============================

### Description

This project provides [BrowserID](http://browserid.org) login integration with the [Spring framework](http://www.springsource.org)

### Simple usage example in [Pentaho BI](http://community.pentaho.com):

1. Build the project
    `ant clean dist`

2. Add the jar from dist/, and httpcore and httpclient from lib/ (remove older version of httpcore if present) to your webapp (ex.:server/webapps/pentaho/WEB-INF/lib)

3. Adapt applicationContext-spring-security-browserid.xml to your needs (as is should work with default hibernate configuration)

4. Move it to the system dir and add it to pentaho-spring-beans.xml

5. In applicationContext-spring-security.xml make sure the BrowserIdProcessingFilter bean is included in FilterChainProxy and BrowserIdAuthenticationProvider is in the AuthenticationManager's provider list

6. Change/create custom PUCLogin.jsp:

6.1 Import BrowserID client-side code:

      <script src="https://browserid.org/include.js" type="text/javascript"></script>

6.2 Add a login button:

      <input type="image" src="https://browserid.org/i/sign_in_green.png" alt="BrowserID login"  onclick="doBrowserIdLogin();">

6.3 Add client code to get an assertion and use it for authentication :

    <script type="text/javascript">

      var verifyBrowserIdLogin = function(assertion){
        if(assertion == null){
        return false;
        }
        
        jQuery.ajax({
            type: 'POST',
            url: 'browserid_security_check',
            data: 'assertion=' + assertion + '&tuid=<%=request.getSession().getAttribute("tuid")%>',
            success:function(data,textStatus,jqXHR){
              bounceToReturnLocation();
            },
            error: function(xhr,  ajaxOptions, thrownError){
              if (xhr.status == 404) {
                // if we get a 404 it means login was successful but intended resource does not exist<commit_msg>readme missing new filter<commit_after>Spring Security BrowserID Login
===============================

### Description

This project provides [BrowserID](http://browserid.org) login integration with the [Spring framework](http://www.springsource.org)

### Simple usage example in [Pentaho BI](http://community.pentaho.com):

1. Build the project
    `ant clean dist`

2. Add the jar from dist/, and httpcore and httpclient from lib/ (remove older version of httpcore if present) to your webapp (ex.:server/webapps/pentaho/WEB-INF/lib)

3. Adapt applicationContext-spring-security-browserid.xml to your needs (as is should work with default hibernate configuration)

4. Move it to the system dir and add it to pentaho-spring-beans.xml

5. In applicationContext-spring-security.xml make sure the CsrfTokenCreationFilter and BrowserIdProcessingFilter beans are included in FilterChainProxy and BrowserIdAuthenticationProvider is in the AuthenticationManager's provider list

6. Change/create custom PUCLogin.jsp:

6.1 Import BrowserID client-side code:

      <script src="https://browserid.org/include.js" type="text/javascript"></script>

6.2 Add a login button:

      <input type="image" src="https://browserid.org/i/sign_in_green.png" alt="BrowserID login"  onclick="doBrowserIdLogin();">

6.3 Add client code to get an assertion and use it for authentication :

    <script type="text/javascript">

      var verifyBrowserIdLogin = function(assertion){
        if(assertion == null){
        return false;
        }
        
        jQuery.ajax({
            type: 'POST',
            url: 'browserid_security_check',
            data: 'assertion=' + assertion + '&tuid=<%=request.getSession().getAttribute("tuid")%>',
            success:function(data,textStatus,jqXHR){
              bounceToReturnLocation();
            },
            error: function(xhr,  ajaxOptions, thrownError){
              if (xhr.status == 404) {
                // if we get a 404 it means login was successful but intended resource does not exist
{'fraction_non_alphanumeric': 0.1148682247637991, 'fraction_numerical': 0.008950770760815515, 'mean_word_length': 3.4403973509933774, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2383776', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1071, 'n_words': 356}