我使用sonarqube 4.3,我在Windowsx86-64中找不到停止声纳的脚本.
有StartSonar.bat没有什么可以阻止是很尴尬的.
当我在linux-x86-64上使用它时,我可以使用./sonar.sh stop.
我看到有一个 StartNTService.bat和一个StoptNTService.bat但我不想安装声纳作为服务.
我的批处理必须使用OAuth2与grant-type Client Credential连接到Web服务
这是代码:
ClientCredentialsResourceDetails resource = new ClientCredentialsResourceDetails();
resource.setAccessTokenUri(accessTokenUri);
resource.setClientId(clientId);
resource.setClientSecret(clientSecret);
ClientCredentialsAccessTokenProvider provider = new ClientCredentialsAccessTokenProvider();
OAuth2AccessToken accessToken = provider.obtainAccessToken(resource, new DefaultAccessTokenRequest());
Run Code Online (Sandbox Code Playgroud)
当执行此代码时,它发出一个请求,其中grant_type在post值中,但clientId和客户端机密放在带有经典基本auth头的头中:
Authorization: Basic bXktY2xpZW50LWlkIDpteS1jbGllbnQtc2VjcmV0
Run Code Online (Sandbox Code Playgroud)
如果我解码字符串bXktY2xpZW50LWlkIDpteS1jbGllbnQtc2VjcmV0
decode64(bXktY2xpZW50LWlkIDpteS1jbGllbnQtc2VjcmV0) -> my-client-id:my-client-secret
Run Code Online (Sandbox Code Playgroud)
这通常很好.但是我们必须使用的Web服务不支持这一点,我们必须将client-id和client-secret放在post-value之类的grant-type中.
有没有办法实现这一目标?一种配置如何发送客户端ID和客户端密钥的方法?
迈克尔
spring spring-security spring-boot spring-security-oauth2 spring-cloud