Search in sources :

Example 11 with JWTNotRequired

use of io.hops.hopsworks.api.filter.JWTNotRequired in project hopsworks by logicalclocks.

the class BannerService method findBanner.

@GET
@Produces(MediaType.APPLICATION_JSON)
@JWTNotRequired
public Response findBanner(@Context SecurityContext sc) {
    Maintenance maintenance = maintenanceController.getMaintenance();
    maintenance.setOtp(settings.getTwoFactorAuth());
    return noCacheResponse.getNoCacheResponseBuilder(Response.Status.OK).entity(maintenance).build();
}
Also used : Maintenance(io.hops.hopsworks.common.maintenance.Maintenance) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) JWTNotRequired(io.hops.hopsworks.api.filter.JWTNotRequired)

Example 12 with JWTNotRequired

use of io.hops.hopsworks.api.filter.JWTNotRequired in project hopsworks by logicalclocks.

the class AuthService method recoverPassword.

@POST
@Path("/recover/password")
@Produces(MediaType.APPLICATION_JSON)
@JWTNotRequired
public Response recoverPassword(@FormParam("email") String email, @Context HttpServletRequest req) throws UserException, MessagingException {
    RESTApiJsonResponse json = new RESTApiJsonResponse();
    String reqUrl = FormatUtils.getUserURL(req);
    userController.sendPasswordRecoveryEmail(email, reqUrl);
    json.setSuccessMessage(ResponseMessages.PASSWORD_RESET);
    return Response.ok(json).build();
}
Also used : RESTApiJsonResponse(io.hops.hopsworks.api.util.RESTApiJsonResponse) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces) JWTNotRequired(io.hops.hopsworks.api.filter.JWTNotRequired)

Aggregations

JWTNotRequired (io.hops.hopsworks.api.filter.JWTNotRequired)12 Produces (javax.ws.rs.Produces)12 Path (javax.ws.rs.Path)10 POST (javax.ws.rs.POST)7 RESTApiJsonResponse (io.hops.hopsworks.api.util.RESTApiJsonResponse)5 GET (javax.ws.rs.GET)5 Users (io.hops.hopsworks.persistence.entity.user.Users)4 UserException (io.hops.hopsworks.exceptions.UserException)2 OauthClient (io.hops.hopsworks.persistence.entity.remote.oauth.OauthClient)2 ApiOperation (io.swagger.annotations.ApiOperation)2 ArrayList (java.util.ArrayList)2 LoginException (javax.security.auth.login.LoginException)2 Response (javax.ws.rs.core.Response)2 DecodedJWT (com.auth0.jwt.interfaces.DecodedJWT)1 NoCacheResponse (io.hops.hopsworks.api.filter.NoCacheResponse)1 DatasetPath (io.hops.hopsworks.common.dataset.util.DatasetPath)1 Maintenance (io.hops.hopsworks.common.maintenance.Maintenance)1 QrCode (io.hops.hopsworks.common.user.QrCode)1 DatasetException (io.hops.hopsworks.exceptions.DatasetException)1 GenericException (io.hops.hopsworks.exceptions.GenericException)1