Changeset 5972
- Timestamp:
- 02/12/15 13:52:06 (9 years ago)
- Location:
- ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java
r5939 r5972 16 16 import clarin.cmdi.componentregistry.impl.database.GroupService; 17 17 import clarin.cmdi.componentregistry.impl.database.ValidationException; 18 import clarin.cmdi.componentregistry.model.AuthenticationInfo; 18 19 import clarin.cmdi.componentregistry.model.BaseDescription; 19 20 import clarin.cmdi.componentregistry.model.Comment; … … 70 71 import javax.ws.rs.core.UriInfo; 71 72 import javax.xml.bind.JAXBException; 73 import org.json.JSONException; 74 import org.json.JSONObject; 72 75 73 76 import org.slf4j.Logger; … … 1996 1999 } 1997 2000 } 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 2015 }
Note: See TracChangeset
for help on using the changeset viewer.