GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GHP Authentication no longer working · gitpython-developers/GitPython · Discussion #1801

GHP Authentication no longer working #1801

Answered by EliahKagan
dorochadev asked this question in Q&A
GHP Authentication no longer working #1801
@dorochadev dorochadev
Jan 12, 2024 · 1 comments · 1 reply
Answered by EliahKagan Return to top
Discussion options
  • Uh oh!

    There was an error while loading. Please reload this page.

  • Uh oh!

    There was an error while loading. Please reload this page.

dorochadev
Jan 12, 2024

Hello, this is the code i have been using for quite some time to update my project from github, coming back to my project after some months it appears github may have changed their api, as using ghp [email protected] no longer works, it prompts me for a password, and then states Support for password authentication was removed on August 13, 2021.

could someone please provide me with the correct way to do this?

def clone_and_replace_repository():

    git.Repo.clone_from(f"https://{config['repository']['token']}@github.com/{config['repository']['path']}.git", 'temp_repo')

    for root, dirs, files in os.walk('temp_repo'):
        if '.git' in dirs:
            dirs.remove('.git')

        for file in files:
            src_file = os.path.join(root, file)
            dest_file = os.path.relpath(src_file, 'temp_repo')
            shutil.copy(src_file, dest_file)

    shutil.rmtree('temp_repo')

    print("Repository cloned and files replaced successfully.")
    ```
You must be logged in to vote
All reactions
Answered by EliahKagan Jan 12, 2024

Is it possible the token has expired?

Both classic (ghp_) and fine-grained (github_pat_) personal access tokens can still be used to authenticate on GitHub by placing them in a URL as the username field with no password (among other ways).

When an incorrect personal access token is used, I have found that the "Support for password authentication was removed on August 13, 2021" message is sometimes shown, even if the attempted token has the correct form for a PAT, and even if it was a previously issued PAT that can no longer be used.

However, I have not been able to make that message appear with a revoked classic PAT (only with a revoked fine-grained PAT). So maybe something else is going …

View full answer

Replies: 1 comment · 1 reply

Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

EliahKagan
Jan 12, 2024
Collaborator

Is it possible the token has expired?

Both classic (ghp_) and fine-grained (github_pat_) personal access tokens can still be used to authenticate on GitHub by placing them in a URL as the username field with no password (among other ways).

When an incorrect personal access token is used, I have found that the "Support for password authentication was removed on August 13, 2021" message is sometimes shown, even if the attempted token has the correct form for a PAT, and even if it was a previously issued PAT that can no longer be used.

However, I have not been able to make that message appear with a revoked classic PAT (only with a revoked fine-grained PAT). So maybe something else is going on in how the URL is being made.

You must be logged in to vote
All reactions
1 reply
@dorochadev
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

dorochadev Jan 12, 2024
Author

Apologies, you are correct, i must've messed something up while replacing my old token with the new one.
Thanks!

All reactions
Answer selected by dorochadev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
@dorochadev @EliahKagan
Converted from issue

This discussion was converted from issue #1800 on January 12, 2024 15:23.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.