G

Saturday, July 2nd, 2022 10:14 PM

Spring Boot - Spring Security Issue

Hi,

I am using the Collibra Spring Boot SDK.
I have encountered an issues which I would like to clarify.
Everything is set correctly in the application.properties file.
I am using Collibra Spring Boot SDK 1.1.5

Spring Security
The connection with our Collibra instance is successful.
However looks like in the next step of resources initialization it errors out as presented below.
Any help would be greatly appreciated.

2022-07-02 15:57:31,484 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting…
2022-07-02 15:57:32,162 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
2022-07-02 15:57:32,319 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Authenticating with the Collibra Platform…
2022-07-02 15:57:35,361 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Successfully authenticated with the Collibra Platform.
2022-07-02 15:57:35,792 [main] INFO org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver - Exposing 14 endpoint(s) beneath base path ‘/manage’
2022-07-02 15:57:35,859 [main] WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘springSecurityFilterChain’ defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method ‘springSecurityFilterChain’ threw exception; nested exception is java.lang.IllegalArgumentException: username cannot be null
2022-07-02 15:57:35,861 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Logging out of the Collibra Platform…

368 Messages

2 years ago

Hello @gheorghe.kobori

Thanks for the provided information.

From the provided logs, it seems that the integration managed to initiate the connection with your Collibra instance.

However, it seems that the it failed when the integration might have been triggered.

Can you please confirm that the following properties are set in the application.properties file and that when the integration is triggered, basic authentication is set accordingly?

  • trigger.api.username
  • trigger.api.password

Additionally, would it be possible to advise which Spring Boot integration is being used from Collibra’s Marketplace?

Also, just to note that v1.1.7 of the Collibra Integration Library has been released.

12 Messages

Hi @spring-team.collibra.com ,

I am using the following template downloaded from the Collibra marketplace:

  • sbi-template-in-memory-database-source-1.0.2

These fields are not set:

  • trigger.api.username
  • trigger.api.password

12 Messages

2 years ago

H @spring-team.collibra.com i,

I set the user name and the password for the trigger.
I still get same error as seen below:

2022-07-05 16:50:58,596 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Authenticating with the Collibra Platform…
2022-07-05 16:51:01,724 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Successfully authenticated with the Collibra Platform.
2022-07-05 16:51:02,176 [main] INFO org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver - Exposing 14 endpoint(s) beneath base path ‘/manage’
2022-07-05 16:51:02,250 [main] WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘springSecurityFilterChain’ defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method ‘springSecurityFilterChain’ threw exception; nested exception is java.lang.IllegalArgumentException: username cannot be null
2022-07-05 16:51:02,253 [main] INFO com.collibra.marketplace.library.integration.InternalSharedLibraryConnection - Logging out of the Collibra Platform…

12 Messages

2 years ago

Hi @spring-team.collibra.com ,

We use basic authentication to connect to our Collibra instance.
So far is working this connectivity.
Do we need to set these also; in my opinion we should not since we use basic authentication.

Properties for configuring the integration to use HTTPs for the listening endpoint (self-signed certificate).

server.ssl.enabled=false
server.ssl.key-alias=
server.ssl.key-store=
server.ssl.key-store-password=
server.ssl.key-password=

368 Messages

2 years ago

Hi @gheorghe.kobori.

trigger.api.username
trigger.api.password
are two properties required by the integration since
the template uses basic authentication on the listening endpoint (used to trigger the integration). Leaving them out of the application.properties file or setting them as null will result in the same error you are receiving.
To fix it, set a value to both properties and send them as part of the request authentication headers,

Thanks

12 Messages

2 years ago

Hi @spring-team.collibra.com ,

I still receive the error even the properties for trigger are set. I already mentioned this in the current thread.

368 Messages

2 years ago

Hello @gheorghe.kobori,

Thanks for the confirming.

Can you please advise how you are triggering/deploying this integration?
Is the application.properties file in the src/main/resources directory being used please?

Additionally, can you please try the following:

  1. Temporarily, comment out all the content in the com.collibra.marketplace.template.sync.db.sample.config.AuthenticationConfig class.
  2. Open the Command Prompt/Terminal.
  3. Go to the integration root directory (i.e. where the pom.xml file is located).
  4. Execute the following command: mvn clean spring-boot:run.
  5. Check whether it is deployed successfully. (There should be a log stating “Started Application”.)

If this works:

  1. Uncomment the com.collibra.marketplace.template.sync.db.sample.config.AuthenticationConfig content.

  2. Locate the following lines from this class:

      .withUser(appConfig.getUsername())
      .password(passwordEncoder().encode(appConfig.getPassword()))
    
  3. Replace

      .withUser(appConfig.getUsername())
    

    with (where <username> should be replaced with a custom username):

      .withUser("<username>")
    
  4. Replace

      .password(passwordEncoder().encode(appConfig.getPassword()))
    

    with (where <password> should be replaced with a custom password):

      .password(passwordEncoder().encode("<password>"))
    
  5. Save the changes made.

  6. Open the Command Prompt/Terminal.

  7. Go to the integration root directory (i.e. where the pom.xml file is located).

  8. Execute the following command: mvn clean spring-boot:run.

  9. Check whether it is deployed successfully. (There should be a log stating “Started Application”.)

In case any of the above fail, can you please share the integration log files as a private message? Thanks

12 Messages

2 years ago

Hi,

Thank you so much for taking the time and helping.
Actually the issue was created due to different artifact versions from pom.xml
Once I reverted to the original pom.xml it worked fine.

You can close the ticket.

368 Messages

2 years ago

Hello @gheorghe.kobori,

Thanks for the update.

Loading...