use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class OAuth2Resource method getOAuth2Config.
@GET
@Path(OAUTH2_CONFIG)
@Produces(MediaType.APPLICATION_JSON)
@ProtectedApi(scopes = { SCOPE_OPENID })
public Response getOAuth2Config() {
AUIConfiguration auiConfiguration = auiConfigurationService.getAUIConfiguration();
OAuth2ConfigResponse oauth2Config = new OAuth2ConfigResponse();
oauth2Config.setAuthzBaseUrl(auiConfiguration.getAuthServerAuthzBaseUrl());
oauth2Config.setClientId(auiConfiguration.getAuthServerClientId());
oauth2Config.setResponseType("code");
oauth2Config.setScope(auiConfiguration.getAuthServerScope());
oauth2Config.setRedirectUrl(auiConfiguration.getAuthServerRedirectUrl());
oauth2Config.setAcrValues("simple_password_auth");
oauth2Config.setFrontChannelLogoutUrl(auiConfiguration.getAuthServerFrontChannelLogoutUrl());
oauth2Config.setPostLogoutRedirectUri(auiConfiguration.getAuthServerPostLogoutRedirectUri());
oauth2Config.setEndSessionEndpoint(auiConfiguration.getAuthServerEndSessionEndpoint());
return Response.ok(oauth2Config).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class LicenseResource method getLicenseDetails.
@GET
@Path(LICENSE_DETAILS)
@ProtectedApi(scopes = { SCOPE_LICENSE_READ })
@Produces(MediaType.APPLICATION_JSON)
public Response getLicenseDetails() {
try {
log.info("Trying to fetch license details.");
LicenseResponse licenseResponse = licenseDetailsService.getLicenseDetails();
return Response.ok(licenseResponse).build();
} catch (Exception e) {
log.error(ErrorResponse.GET_LICENSE_DETAILS_ERROR.getDescription(), e);
return Response.serverError().entity(ErrorResponse.GET_LICENSE_DETAILS_ERROR.getDescription()).build();
}
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class AttributesResource method patchAtribute.
@PATCH
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
@ProtectedApi(scopes = { ApiAccessConstants.ATTRIBUTES_WRITE_ACCESS })
@Path(ApiConstants.INUM_PATH)
public Response patchAtribute(@PathParam(ApiConstants.INUM) @NotNull String inum, @NotNull String pathString) throws JsonPatchException, IOException {
log.debug(" GluuAttribute details to patch - inum = " + inum + " , pathString = " + pathString);
GluuAttribute existingAttribute = attributeService.getAttributeByInum(inum);
checkResourceNotNull(existingAttribute, GLUU_ATTRIBUTE);
existingAttribute = Jackson.applyPatch(pathString, existingAttribute);
attributeService.updateAttribute(existingAttribute);
return Response.ok(existingAttribute).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class ConfigResource method getAppConfiguration.
@GET
@ProtectedApi(scopes = { ApiAccessConstants.JANS_AUTH_CONFIG_READ_ACCESS })
public Response getAppConfiguration() {
AppConfiguration appConfiguration = configurationService.find();
log.debug("ConfigResource::getAppConfiguration() appConfiguration - " + appConfiguration);
return Response.ok(appConfiguration).build();
}
use of io.jans.configapi.core.rest.ProtectedApi in project jans by JanssenProject.
the class JwksResource method deleteKey.
@DELETE
@ProtectedApi(scopes = { ApiAccessConstants.JWKS_WRITE_ACCESS })
@Path(ApiConstants.KID_PATH)
public Response deleteKey(@PathParam(ApiConstants.KID) @NotNull String kid) {
log.debug("Key to be to be deleted - kid = " + kid);
final Conf conf = configurationService.findConf();
WebKeysConfiguration webkeys = configurationService.findConf().getWebKeys();
JSONWebKey jwk = getJSONWebKey(webkeys, kid);
if (jwk == null) {
throw new NotFoundException(getNotFoundError("JWK with kid - '" + kid + "' does not exist!"));
}
conf.getWebKeys().getKeys().removeIf(x -> x.getKid() != null && x.getKid().equals(kid));
configurationService.merge(conf);
return Response.noContent().build();
}
Aggregations