@ PUT @ Path ( "{user}" ) @ Consumes ( MediaType . TEXT_PLAIN ) public Response addUser ( @ PathParam ( "user" ) String username , @ HeaderParam ( "Authorization" ) @ DefaultValue ( "no token" ) String auth , String message ) throws Exception { if ( ! this . isAuth ( auth ) ) { throw new Exception ( "Unauthorized!" ) ; } if ( realm != null ) { AuthenticationManagerRequest req = new AuthenticationManagerRequest ( ) ; req . setAccountName ( username ) ; req . setPassword ( message ) ; req . setRequestType ( RequestType . ADD ) ; sendMessage ( req ) ; return Response . created ( new URI ( "" ) ) . build ( ) ; } return Response . status ( Status . NOT_FOUND ) . build ( ) ; }
Adds user credentials for access to this site only .