0

I am working on a PHP website which is using the php_svn module to retrieve data from our SVN repositories. For this I have set internally a hardcoded user/pwd so I can connect (dirty way...)

Now I would like to connect using my current LDAP user. Means that once I try to connect to SVN, then PHP should be able to retrieve my current windows session (the client side that executes IE,etc..) and pass it to SVN so it will still recognise me without prompting user/pwd...

Not sure if this is possible but would be brilliant to achieve it :)

Has someone achieved something similar? In the php_svn site not much information is available for this specific point...

http://php.net/manual/en/book.svn.php

Thanks in advance!

6
  • It seems like you're trying to get a web request to be session based. Web requests are stateless (meaning each request starts over from a blank slate). If you want to maintain credentials between requests, you'll need to use some kind of session handler. PHP has a built in one. php.net/manual/en/book.session.php Commented Feb 9, 2017 at 15:48
  • THanks Ian!, How would then PHP use this session to log into the SVN repository? THe idea is that I can login into SVN without informing any user/password, just the current active windows session.... Commented Feb 9, 2017 at 15:54
  • You wouldn't be able to do that directly. The information has to make its way from the windows session, into the browser, which isn't really possible without some kind of browser plugin... the more realistic way to do this is: have the user log in to the website, submit their credentials, then store them in a PHP session, to be re-used by PHP on every subsequent page load. Commented Feb 9, 2017 at 15:57
  • Thanks! I think I start to understand the concept. Was thinking that the session itself (identified via LDAP) could be shared to other systems to somehow "reuse" this. Instead of this Ill follow your advice to simply store credentials in the session and share it among all those systems that require the same set of credentials for identification. Commented Feb 9, 2017 at 18:33
  • By the way... not sure how can I mark your answer as an answer :( Commented Feb 9, 2017 at 18:34

1 Answer 1

1

It seems like you're trying to get a web request to be session based. Web requests are stateless (meaning each request starts over from a blank slate). If you want to maintain credentials between requests, you'll need to use some kind of session handler. PHP has a built in one. http://php.net/manual/en/book.session.php

You won't be able to directly access the 'windows session' however. The information has to make its way from the windows session, into the browser, which isn't really possible without some kind of browser plugin... the more realistic way to do this is: have the user log in to the website, submit their credentials, then store them in a PHP session, to be re-used by PHP on every subsequent page load.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.