question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Requiring Forms authentication to list/download packages

See original GitHub issue

I’m trying to secure a gallery (both the user-visible website and the api) and will not be able to use windows authentication. I’d like to limit package listing and download to the accounts that people can register for on the site. I tried setting things up as forms authentication with the following configuration entry, but after filling in my account info on the /users/account/logon page and hitting submit, I get redirected back to the logon page.

<authentication mode="Forms">
  <forms loginUrl="/users/account/Logon"/>
</authentication>
<authorization>
  <deny users="?" />
</authorization>

From a quick look at the gallery code, the LogOn() method on AuthenticationController uses SignIn() as the method to take the posted information, which doesn’t seem to play nicely with Forms authentication. If I rename the SignIn() method to LogOn(), Forms authentication and requiring a logon works for the website, but api access (via the Visual Studio Extension) never prompts me to log-on, it just sits there spinning.

I haven’t tracked down exactly what’s going on with the Visual Studio Extension yet, but I wanted to check to see if there’s an easier option to turn off anonymous listing/downloading of packages that I just didn’t see documented before I dug into the issue further.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
DoCodecommented, Dec 17, 2016

+++1 Incredible, can it really be true that 2016 nobody has a functioning NuGet Gallery WITH authentication running!? When really NOT, then please PING me and we start a new fork for this! ::: Beautiful 3rd advent! :::

0reactions
maartenbacommented, Aug 17, 2016

Definitely IIS hijacking the redirect. Can you check the ApiKeyAuthenticationHandler? We use an explicit 403 there to make the authentication trigger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use ASP.NET forms-based authentication
This article demonstrates how to implement forms-based authentication in ASP.NET applications by using a database to store the users.
Read more >
ASP.NET Forms authentication requires Anonymous enabled
Forms authentication lets you authenticate users by using your own code and then maintain an authentication token in a cookie or in the...
Read more >
hydra | Kali Linux Tools
Packages and Binaries: hydra. Hydra is a parallelized login cracker which supports numerous protocols to attack. It is very fast and flexible, ...
Read more >
Wordpress cve list. WordPress through 6. NVD Analysts use pub
This, for example, allows attackers to run the elFinder upload (or mkfile and put) command to write PHP code into the wp NOTICE:...
Read more >
2.3 Ensure 'forms authentication' require SSL - Applications
Solution · 1. Open IIS Manager and navigate to the appropriate tier · 2. In Features View, double-click Authentication · 3. On the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found