PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 21, 2022

[FIXED] Private Gitlab composer repository access

 January 21, 2022     composer-php, gitlab, php     No comments   

Issue

I am trying to get my composer file to pull a repository from Gitlab but so far it is still asking for my username & password.

{
"repositories": [
    {
        "type": "package",
        "package": {
            "name": "composer-pkg-name",
            "version": "0.1.0",
            "type": "package",
            "source": {
                "url": "https://blah@gitlab.com/repo-url,
                "type": "git",
                "reference": "master"
            },
            "autoload": {
                "classmap": [""]
            }
        }
    }
],
"require": {
    "blah/composer-pkg-name": "0.1.0"
},
"config": {
    "gitlab.com": "secret-account-access-token"
}}

Solution

Create auth.json file in your composer home. Eg. /home/username/.config/composer if you use ubuntu

{
    "http-basic": {
        "gitlab.com": {
            "username": "login",
            "password": "password"
        }
    }
}


Answered By - Adam W.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing