Authentication issue with repo accessed from Spring Cloud Config Server hosted on GitHub

spring cloud config server: git searchpaths
spring cloud config server without git example
spring cloud config server: git default label
spring cloud config multiple profiles
spring cloud config server github
spring cloud config server: vault
spring cloud config server: native: searchlocations
spring cloud config server with example in a spring boot app tech primers

I'm hosting a configuration in a repo on GitHub. If I keep the repo public all's good, but if I make it private I face:

org.eclipse.jgit.errors.TransportException: 
 https://github.com/my-user/my-repo:
 Authentication is required but no CredentialsProvider has been registered

the property I use to target the repo is

spring.cloud.config.server.git.uri=https://github.com/my-user/my-repo

What should I do to configure this properly with the private repo, thanks

you need to add the

spring.cloud.config.server.git.username=your_github_username
spring.cloud.config.server.git.password=your_github_password

and things should workout for you

spring-cloud/spring-cloud-config, I have simple spring boot config server application. My backend is gitlab and it is private repository. I can't get it working by providing authentication information. together to host and review code, manage projects, and build software together. I also faced a similar problem with spring cloud config server. Set up a Spring Cloud Config Server instance for your service. 10/18/2019; 8 minutes to read +4; In this article. This article shows you how to connect a Spring Cloud Config Server instance to your Azure Spring Cloud service. Spring Cloud Config provides server and client-side support for an externalized configuration in a distributed system.

 - SPRING_CLOUD_CONFIG_SERVER_GIT_USERNAME=XXXXX
  - SPRING_CLOUD_CONFIG_SERVER_GIT_PASSWORD=XXXXXXXXXXXX
  - SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT-LABEL=branchXXXXX

I am running this as docker, and it worked for me

for started this how I am using spring cloud server as docker container

container_name: sccserver
ports:
  - 8080:8080
volumes:
  - /data/config-dir:/data
environment:
  - EUREKA_HOST=$DOCKERHOST
  - scc_search_paths={application}, {application}/extended-attributes, {application}/feature-flags, {application}/properties, {application}/error-codes,{application}/seed-data,{application}/globalization,{application}/json-validator-schema,{application}/seedData
  - VIRTUAL_HOST=$DOCKERHOST
  - MESSAGING_HOST=$DOCKERHOST
  - SCC_GIT_URI=https://bitbucket.com/scm/dmwhrndc/configuration.git 
  - "JAVA_OPTS=-Xmx512m"
  - SCC_GIT_SKIPSSLVALIDATION=true
  - SPRING_CLOUD_CONFIG_SERVER_GIT_USERNAME=
  - SPRING_CLOUD_CONFIG_SERVER_GIT_PASSWORD=
  - SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT-LABEL=
extra_hosts:
  - "dockerhost:$DOCKERHOST"

~

spring config server :Cannot clone or checkout repository , You should use a server to host your configuration repositories in production. Spring Cloud Config Server supports a git repository URL with placeholders spring: cloud: config: server: git: uri: https://github.com/myorg/{application} AWS CodeCommit uses an authentication helper when using Git from the command line. The sample has a test case where the config server is also started in the same JVM (with a different port), and the test asserts that an environment property from the git configuration repo is present. To change the location of the config server, you can set spring.cloud.config.uri in bootstrap.yml (or in system properties and other places).

It's not recommended to hardcode GitHub username and password into application.yml. You'll be at risk of leaking GitHub account and open access of your config repository to anyone on the web.

You can use ssh as authentication method by adding the following configuration:

spring:
  cloud:
    config:
      server:
        git:
          uri: git@github.com:qianyanseu/EagleEye-config.git
          searchPaths: licensingservice,organizationservice
          private_key_file: ~/.ssh/github_rsa

As GitHub has updated authentication algorithm, if you're using earlier version of spring cloud, you'll also need to add the following dependency to pom.xml:

<dependency>
   <groupId>com.jcraft</groupId>
   <artifactId>jsch</artifactId>
   <version>0.1.53</version>
</dependency>

2. Spring Cloud Config Server, Spring Cloud Config provides server-side and client-side support for externalized spring: cloud: config: server: git: uri: https://github.com/spring-cloud-samples/ config-repo word application- to prevent issues resolving the correct property source. host. The host of the proxy. port. The port with which to access the proxy. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Spring Cloud Config Server client, Spring Config Server allows to fetch a configuration from the remote git config: server: git: uri: https://github.com/my-organization/my-config-repo.git username: The repository is accessed by using JGit, so any documentation you find on Turns out the problem is hidden in the bowels of Mac OS Mojave� The default implementation of EnvironmentRepository uses a Git backend, which is very convenient for managing upgrades and physical environments and for auditing changes. . To change the location of the repository, you can set the spring.cloud.config.server.git.uri configuration property in the Config Server (for example in application.ym

Solved, I had trouble getting this to work against my Github account using a private repo. It's unclear why it fails, JGit just say "not authorized", which I� server.port defines the port on which the embedded server will start. spring.cloud.config.server.git.uri will bind the git location to look for the configuration. Here we are using local git repo but can be switched to remote got location by just changing this location.

Git Backend not working for Spring Config server, Learn how to set up a Spring Cloud Config Server instance for your Azure Spring Cloud on the Azure portal. Azure Spring Cloud supports Azure DevOps, GitHub , GitLab, and Bitbucket for Private repository with SSH authentication private- key, No, The SSH private key to access the Git repository,� Like all Spring Boot applications, it runs on port 8080 by default, but you can switch it to the more conventional port 8888 in various ways. The easiest, which also sets a default configuration repository, is by launching it with spring.config.name=configserver (there is a configserver.yml in the Config Server jar).

Comments
  • the private_key_file is not present in docs, and actually not working for me. Is it removed now?
  • @mCs I checked and found it is not in the latest docs. But it truly works and a log of examples and gists contain this setting. Maybe you can consider store the privateKey in an environment variable instead.
  • How to use PK form environment var?
  • private_key_file property does not work. I got the help from this stackoverflow.com/questions/38108817/… and it solved my problem.