Changeset 5973 for ComponentRegistry


Ignore:
Timestamp:
02/12/15 14:35:05 (9 years ago)
Author:
Twan Goosen
Message:

moved /authentication into separate resource (so now we have /rest/authentication)
added POST method, which only does a redirect to the front end but is configured to require authentication by means of the SHHAA configuration

Location:
ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java

    r5972 r5973  
    1616import clarin.cmdi.componentregistry.impl.database.GroupService;
    1717import clarin.cmdi.componentregistry.impl.database.ValidationException;
    18 import clarin.cmdi.componentregistry.model.AuthenticationInfo;
    1918import clarin.cmdi.componentregistry.model.BaseDescription;
    2019import clarin.cmdi.componentregistry.model.Comment;
     
    7170import javax.ws.rs.core.UriInfo;
    7271import javax.xml.bind.JAXBException;
    73 import org.json.JSONException;
    74 import org.json.JSONObject;
    7572
    7673import org.slf4j.Logger;
     
    19991996        }
    20001997    }
    2001 
    2002     @GET
    2003     @Path("/authentication")
    2004     @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    2005     @ApiOperation(value = "Information on the current authentication state")
    2006     public AuthenticationInfo getAuthenticationInformation() throws JSONException, AuthenticationRequiredException {
    2007         final Principal userPrincipal = security.getUserPrincipal();
    2008 
    2009         if (userPrincipal == null) {
    2010             return new AuthenticationInfo(false);
    2011         } else {
    2012             return new AuthenticationInfo(getUserCredentials(userPrincipal));
    2013         }
    2014     }
     1998   
    20151999}
  • ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main/webapp/WEB-INF/shhaa.xml

    r5871 r5973  
    3535       
    3636        <authorization>
    37             <location  target="/admin/*" />
     37            <location target="/admin/*" />
     38            <location target="/rest/authentication" methods="POST" />
    3839        </authorization>
    3940       
Note: See TracChangeset for help on using the changeset viewer.