Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48696d0374 | ||
|
|
77a5b81b2c |
@ -119,16 +119,18 @@ public class SpringDocConfiguration {
|
|||||||
|
|
||||||
private OAuthFlows createOAuthFlows(SpringDocProperties springDocProperties) {
|
private OAuthFlows createOAuthFlows(SpringDocProperties springDocProperties) {
|
||||||
|
|
||||||
OAuthFlow flow = createAuthorizationCodeFlow(springDocProperties);
|
var codeFlow = new OAuthFlow().authorizationUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/auth")
|
||||||
|
|
||||||
return new OAuthFlows().authorizationCode(flow);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private OAuthFlow createAuthorizationCodeFlow(SpringDocProperties springDocProperties) {
|
|
||||||
|
|
||||||
return new OAuthFlow().authorizationUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/auth")
|
|
||||||
.tokenUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/token");
|
.tokenUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/token");
|
||||||
|
|
||||||
|
var flows = new OAuthFlows().authorizationCode(codeFlow);
|
||||||
|
|
||||||
|
if (springDocProperties.isShowImplicitFlow()) {
|
||||||
|
var implicitFlow = new OAuthFlow().authorizationUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/auth")
|
||||||
|
.tokenUrl(springDocProperties.getAuthServerUrl() + PROTOCOL_URL_FORMAT + "/token");
|
||||||
|
flows.implicit(implicitFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
return flows;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public class SpringDocProperties {
|
|||||||
private String title ="Service Open API Documentation";
|
private String title ="Service Open API Documentation";
|
||||||
private String description ="Service Open API Documentation";
|
private String description ="Service Open API Documentation";
|
||||||
private String version = "1.0";
|
private String version = "1.0";
|
||||||
|
private boolean showImplicitFlow = true;
|
||||||
|
|
||||||
private List<String> packagesToScan = new ArrayList<>();
|
private List<String> packagesToScan = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user