RED-4515: Changed swagger back to authorizationCode flow

This commit is contained in:
deiflaender 2023-03-24 10:34:14 +01:00
parent 09291ea39d
commit 1a41edbef9
2 changed files with 13 additions and 4 deletions

View File

@ -5,8 +5,6 @@ import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import org.keycloak.adapters.springboot.KeycloakSpringBootProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties; import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
@ -119,7 +117,7 @@ public class SwaggerAutoConfiguration {
OAuthFlow flow = createAuthorizationCodeFlow(); OAuthFlow flow = createAuthorizationCodeFlow();
return new OAuthFlows().implicit(flow); return new OAuthFlows().authorizationCode(flow);
} }

View File

@ -222,8 +222,19 @@ public class TenantManagementService {
redactionClient.setImplicitFlowEnabled(true); redactionClient.setImplicitFlowEnabled(true);
redactionClient.setDirectAccessGrantsEnabled(true); redactionClient.setDirectAccessGrantsEnabled(true);
var swaggerClient = new ClientRepresentation();
swaggerClient.setEnabled(true);
swaggerClient.setName("swagger-ui-client");
swaggerClient.setClientId("swagger-ui-client");
swaggerClient.setStandardFlowEnabled(true);
swaggerClient.setImplicitFlowEnabled(false);
swaggerClient.setDirectAccessGrantsEnabled(false);
swaggerClient.setServiceAccountsEnabled(true);
swaggerClient.setAuthorizationServicesEnabled(true);
swaggerClient.setSecret("OsloImWinter!23");
redaction.setClients(List.of(redactionClient));
redaction.setClients(List.of(redactionClient, swaggerClient));
var redUserRole = new RoleRepresentation(); var redUserRole = new RoleRepresentation();
redUserRole.setComposite(true); redUserRole.setComposite(true);
redUserRole.setName(RED_USER_ROLE); redUserRole.setName(RED_USER_ROLE);