Home > Net >  Git Authentication Failure Spring Cloud config store
Git Authentication Failure Spring Cloud config store

Time:01-05

We are configuring spring cloud config server and below is how my application properties look:

server.port=8080
spring.cloud.config.server.git.uri=https://github.com/myorganization/config-store.git
spring.cloud.config.server.git.searchPaths={application}
spring.cloud.config.server.git.clone-on-start=true
spring.cloud.config.server.git.skipSslValidation=true
spring.cloud.config.server.git.ignore-local-ssh-settings=true
spring.cloud.config.server.git.username=MyUser
spring.cloud.config.server.git.password=MyPassword
spring.cloud.config.server.git.default-label=develop
spring.application.name=config-server
spring.security.user.name=root
spring.security.user.password=password

I am able to login to the github url i.e. https://github.com/myorganization/config-store.git using the username MyUser and password MyPassword as per above properties but when i am trying to start my config server using: ./mvnw spring-boot:run i am getting the below error:

Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/myorganization/config-store.git: not authorized

i have tried out many things but running out of any ideas now, would appreciate any help in advance.

CodePudding user response:

The use of username and password to do git operations on GitHub is deprecated and it no longer works, as described here.

You should generate a Personal Access Token, follow the official documentation to do it. Then you can add the token to the spring configuration as it was you password:

spring.cloud.config.server.git.username=<yourusername>
spring.cloud.config.server.git.password=<yourtoken>

CodePudding user response:

Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com.

From : https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

Thx to: https://stackoverflow.com/a/70443213/592355

For Github Enterprise Server, our options (also) are limited, but considered secure & well documented:

Authenticating with the API

You can authenticate with the API in different ways. ...

Authenticating with the command line

...

  • HTTPS ...
  • SSH ...

When SSH, for the -end:

Use "local ssh environment" or see: https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_git_ssh_configuration_using_properties

  •  Tags:  
  • Related