Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to get User info from personal access token(How to get User info from personal access token)
How to get User info from personal access token [message #1853182] Wed, 22 June 2022 07:06 Go to next message
Mounika Mantri is currently offline Mounika MantriFriend
Messages: 6
Registered: February 2022
Junior Member
Hi Team,

Is there any API which gives user info of gitlab/github by passing access token ?

Thanks,
Mounika.
Re: How to get User info from personal access token [message #1853185 is a reply to message #1853182] Wed, 22 June 2022 07:51 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 494
Registered: August 2016
Senior Member
Please don't cross-post: https://www.eclipse.org/forums/index.php/t/1111027/

It's unclear what you are asking about. An API where? If you're looking for a GitHub/Gitlab API, check their API documentation.
Re: How to get User info from personal access token [message #1853214 is a reply to message #1853185] Thu, 23 June 2022 09:07 Go to previous messageGo to next message
Mounika Mantri is currently offline Mounika MantriFriend
Messages: 6
Registered: February 2022
Junior Member
Hi,

We have personal access token from github/gitlab, with that token we are able to perform actions like clone,commit,push,pull etc using JGIT.
We would like to access personal information like user id, email id for that personal access token. What is the api we need to use for getting this?
Re: How to get User info from personal access token [message #1853216 is a reply to message #1853214] Thu, 23 June 2022 09:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32498
Registered: July 2009
Senior Member
I think you are asking for something that's not possible and kind of nonsensical. The personal access token is like a password and your question is like asking "Given a github password, I'd like to find out for which account is that the password?"

Perhaps do some Googling and reading will help, e.g.,

https://www.edgoad.com/2021/02/using-personal-access-tokens-with-git-and-github.html

You must know the user ID to do anything with the PAT. Or are you asking how to find user.id/user.email information in the git config? That question has nothing to do with there being a PAT or not...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to get User info from personal access token [message #1853228 is a reply to message #1853214] Thu, 23 June 2022 13:07 Go to previous messageGo to next message
Cody Mikol is currently offline Cody MikolFriend
Messages: 5
Registered: December 2021
Junior Member
Hey, I think you actually want to generate an ssh key and add it to github. That will allow you to interact with github from your command line with no further configuration.

There is a pretty good guide here https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

You might get a little flack from this community as its not affiliated with GitHub, but rather an implementation of the program git in java.

Good luck!
Re: How to get User info from personal access token [message #1853256 is a reply to message #1853228] Fri, 24 June 2022 10:45 Go to previous messageGo to next message
Mounika Mantri is currently offline Mounika MantriFriend
Messages: 6
Registered: February 2022
Junior Member
Basically, I want to know user name and user email from git.
I have seen PersonIdent class by passing repo as input. But it is not giving me actual user name and email id.
Could you please help me

[Updated on: Fri, 24 June 2022 10:47]

Report message to a moderator

Re: How to get User info from personal access token [message #1853262 is a reply to message #1853256] Fri, 24 June 2022 12:55 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 494
Registered: August 2016
Senior Member
Now this sounds like a duplicate of https://www.eclipse.org/forums/index.php/t/1111060/ . See there.
Previous Topic:Does JGIT allow for running commands in parallel?
Next Topic:Retrieve User Name and Email Address from the Git Repo
Goto Forum:
  


Current Time: Wed Sep 28 16:42:12 GMT 2022

Powered by FUDForum. Page generated in 0.01823 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top