I tried to integrate Azure AD with a Spring Boot web application, I followed the example from the Azure's documentation but I encountered an error message: "[invalid_request] AADSTS9000411: The request is not properly formatted. The parameter 'scope' is duplicated...", as shown in the below screenshot.
I can't find any scope parameter to figure out why it says is duplicated.
I have in the application.properties file the following setup:
spring.cloud.azure.active-directory.enabled=true
#Specifies your Active Directory ID:
spring.cloud.azure.active-directory.credential.client-id=...
spring.cloud.azure.active-directory.profile.tenant-id=...
spring.cloud.azure.active-directory.credential.client-secret=...
Does anyone had the same issue?
Related
Currently, I am working on upgrading Java and Spring Boot version for my application from Java 8 to Java 17 and then Spring Boot to 2.7.4.
With this upgrade, application started giving below exception while setting the access token.
I am passing the access token related information to another JAR which then retrieves the token information from token master.
Same configuration file worked with Java 8 and I am sure it is not corrupted. When I debug, I observed that Spring Boot is not able to parse ASCII space which was somehow handled in previous versions. Have anyone faced similar issue?
java.lang.IllegalArgumentException: scope "audience:server:client_id:ADD_00000 AAA:drr:BADAM.SS_" contains invalid characters
at org.springframework.util.Assert.isTrue(Assert.java:121)
at org.springframework.security.oauth2.client.registration.ClientRegistration$Builder.validateScopes(ClientRegistration.java:706)
at org.springframework.security.oauth2.client.registration.ClientRegistration$Builder.build(ClientRegistration.java:625)
at com.restclient.oauth2.SpringSecurityRequestInterceptor.createClientRegistration(SpringSecurityRequestInterceptor.java:165)
at com.restclient.oauth2.SpringSecurityRequestInterceptor.<init>(SpringSecurityRequestInterceptor.java:59)
at com.restclient.oauth2.OAuth2RequestInterceptor.<init>(OAuth2RequestInterceptor.java:38)
at com.restclient.feign.FeignRestClientBuilder.setTokenAuthentication(FeignRestClientBuilder.java:156)
at com.restclient.RestClientHolder.configureBuilder(RestClientHolder.java:275)
at com.restclient.RestClientHolder.getBuilder(RestClientHolder.java:313)
at com.restclient.RestClientHolder.getService(RestClientHolder.java:319)
at com.restclient.RestHelper.getService(RestHelper.java:34)
at com.restclient.RestHelper.getService(RestHelper.java:80)
I'm trying to update my project Spring Boot version from 2.4.13 to 2.6.12
We were using Spring Cloud 2020.0.0-M6 and I also wanted to bump the version to 2021.0.4
Now my application won't load its remote configuration even though I can see in the logs that it finds the service and the configuration!!
In the above picture you can see my app does find the config-service once deployed to our Development environment.
And after that, it throws me an error because it's trying to use its local configuration where I'm using Environment Variables set from my IDE, using the following syntax ${var}, to replace the value depending on the Run/Debug Configuration.
In the meantime, I'm trying to use Spring Boot 2.6.11 with Spring Cloud 2021.0.4. If I can't get it to work I will have to downgrade it to the last working version until I find the problem.
Any help is appreciated!
Thanks
I am working on setting up Auth0 with my Spring Boot application. I've been following Auth0's guide (https://auth0.com/docs/quickstart/webapp/java-spring-boot/01-login), but am getting an error:
Login with OAuth 2.0
[invalid_request] no connections enabled for the client
https://[removed].auth0.com/
The Allowed Callback URL is set to: http://localhost:8081/login/oauth2/code/auth0
The spring-boot-starter-oauth2-client has been added
I have the following in my application.properties file:
spring.security.oauth2.client.registration.auth0.client-id=[removed]
spring.security.oauth2.client.registration.auth0.client-secret=[removed]
spring.security.oauth2.client.registration.auth0.scope[0]=email
spring.security.oauth2.client.provider.auth0.issuer-uri=https\://[removed].auth0.com/
The SecurityFilterChain and Controller are both direct copies from the guide. The index.html page has a link to:
<a th:href="#{/oauth2/authorization/auth0}">Log In</a>
I can't find anything on Auth0's website or any forum that to help determine where the error is coming from. Any ideas on where I can look?
I am following this part in the tutorial for integrating key vault with spring boot.
We have everything setup for using Managed identities (application.properties and dependency in pom) and since it doesn't run in local development, I am testing it by deployment, however I am getting these errors in the log stream:
java.io.FileNotFoundException:/home/tomcat/lib/azure.appservice.jar (No such file or directory)
and
java.lang.IllegalStateException: Failed to configure KeyVault property source
java.io.IOException: Server returned HTTP response code: 400 for URL: Http://xxx.xx.x.x.x
EDIT: turned out I had a typo error in the client-id property.
make sure the application has permissions to get and list secrets in access policies of your key vault and also check the jar files are added properly.
Edit the src/main/resources/application.properties file so that it has the following contents, adjusting the values for your Azure subscription.c
azure.keyvault.client-id=<your client ID>
azure.keyvault.client-key=<your client key>
azure.keyvault.enabled=true
azure.keyvault.tenant-id=<your tenant ID>
azure.keyvault.uri=https://contosokv.vault.azure.net/
After adding azure.keyvault.tenant-id=<your-tenant-id> in the file:
For more details refer this document and follow this Github code
We have a web based application with Front end in Angular JS 1 and REST service with Spring jersey frame work.We are using Spring 3.We have deployed our project in Tomcat 9.We have deployed angular js part as a separate project and REST service is build as a war file and deployed separately.
Suppose our application url is https://10.100.200.300:8443/DEMO.When we are trying to access the URL with a wrong value say https://10.100.200.300:8443/DEMO_TEST we are getting the error 404 i.e. resource not found by the tomcat server.We want to show some customized error page for 404 or any other tomcat error. Please suggest how to do it?
You can have a look here - Configure spring boot to redirect 404 to a single page app
Make spring configuration as mentioned in above answer and reroute it to your desired page.