Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342592 - HTTP authentication doesn't work
Summary: HTTP authentication doesn't work
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 3.3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-12 11:05 EDT by Daniel Kozak CLA
Modified: 2014-03-24 17:17 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kozak CLA 2011-04-12 11:05:19 EDT
Build Identifier: 20110301-1815

I create my own http git repository, and from console its ok (push, clone), but from egit It doesn work properly, I can clone repo but I am unable to push anything to remote repository. Everytime when i try push I get this error:
egit  An internal Exception occured during push: http://git.auto-gps.eu/git/eurosat.git/: 401 Authorization Required.

Reproducible: Always

Steps to Reproduce:
1. make some changes in project
2. commit changes
3. try to push changes to remote repository
Comment 1 Matthias Sohn CLA 2011-04-19 07:27:22 EDT
What's the server environment you are pushing to ?
Which authentication method does the server you are trying to push to require ?
Do you have permission to push changes (depends on server side implementation) ?
Comment 2 Daniel Kozak CLA 2011-04-19 07:42:27 EDT
(In reply to comment #1)
> What's the server environment you are pushing to ?
> Which authentication method does the server you are trying to push to require ?
> Do you have permission to push changes (depends on server side implementation)
> ?

I setup my own server, I try both (basic and digest) auth method. Yes I have permission to push changes. When I use git from cmdline everything is OK.

part of my apache vhost config 

<LocationMatch "^/git/.*/git-receive-pack$">
       Options Indexes FollowSymLinks MultiViews ExecCGI
       AuthType Basic
       AuthName "Git"
       AuthUserFile /etc/apache2/passwd/passwords
       Require valid-user
</LocationMatch> 

apache git config

SetEnv GIT_PROJECT_ROOT /var/www/html/system/web/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
Comment 3 Lars Kneschke CLA 2011-04-24 02:53:43 EDT
See also bug #339220 and #338048.

The values stored in the input fields don't get used for authentication. I validated this using whireshark. 

The only way to get authentication working is to enter the username and password in the git repository url. Which is very unsecure, as the git repository get's added to commit messages sometimes.
Comment 4 Matthias Sohn CLA 2014-03-17 06:12:31 EDT
proposed patches
EGit https://git.eclipse.org/r/#/c/23443/
JGit https://git.eclipse.org/r/#/c/23441/
Comment 5 Matthias Sohn CLA 2014-03-24 17:17:24 EDT
jgit:
https://git.eclipse.org/r/#/c/23441/
merged as 8598fe3d2bdc6e4a7e136a8579fad2545f34f546

egit:
https://git.eclipse.org/r/#/c/23643/
merged as bba4e7ff4321b0748d4687e0d40bbf23de5a81d3
https://git.eclipse.org/r/#/c/23443/
merged as b5a2d497ae44fa7ba99a93bb31fc2f0c7c8b7304