Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #89 from unosquare/NetCoreSupport
Browse files Browse the repository at this point in the history
Net Core support
  • Loading branch information
geoperez authored Dec 8, 2017
2 parents fa249f1 + f5454e1 commit 8aeff83
Show file tree
Hide file tree
Showing 73 changed files with 1,517 additions and 886 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,7 @@ FakesAssemblies/
*.opt
/src/Unosquare.PassCore.Web/wwwroot/vendor
/src/Unosquare.PassCore.Web/project.lock.json
/src/Unosquare.PassCore.Web/.vscode/launch.json
/src/Unosquare.PassCore.Web/.vscode/tasks.json
/src/Unosquare.PassCore.Web/wwwroot/**
/src/Unosquare.PassCore.Web/package-lock.json
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[![Build status](https://ci.appveyor.com/api/projects/status/76nxqw893mk7xfb9/branch/master?svg=true)](https://ci.appveyor.com/project/geoperez/passcore/branch/master)[![Analytics](https://ga-beacon.appspot.com/UA-8535255-2/unosquare/passcore/)](https://github.com/igrigorik/ga-beacon)

# <img src="https://raw.githubusercontent.com/unosquare/passcore/master/src/Unosquare.PassCore.Web/wwwroot/images/passcore-logo.png"></img>
**PassCore: A self-service password change utility for Active Directory [![Analytics](https://ga-beacon.appspot.com/UA-8535255-2/unosquare/passcore/)](https://github.com/igrigorik/ga-beacon)**
**PassCore: A self-service password change utility for Active Directory **

*:star:Please star this project if you find it useful!*

## Overview

PassCore is a very simple 1-page web application written in <a target="_blank" href="https://github.com/dotnet/roslyn">C#</a>, using <a href="https://github.com/aspnet" target="_blank">ASP.NET 5</a>, <a href="https://github.com/twbs/bootstrap" target="_blank">Bootstrap</a>, <a href="https://github.com/angular" target="_blank">AngularJS</a> and <a href="https://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory(v=vs.110).aspx" target="_blank">Microsoft Directory Services</a>. It allows users to change their Active Directory password on their own, provided the user is not disabled.
PassCore is a very simple 1-page web application written in <a target="_blank" href="https://github.com/dotnet/roslyn">C#</a>, using <a href="https://github.com/aspnet" target="_blank">ASP.NET 5</a>, <a href="https://github.com/angular/material2" target="_blank">Angular Material</a>, <a href="https://github.com/angular/angular" target="_blank">Angular</a> and <a href="https://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory(v=vs.110).aspx" target="_blank">Microsoft Directory Services</a>. It allows users to change their Active Directory password on their own, provided the user is not disabled.

PassCore does not require any configuration, as it obtains the principal context from the current domain. I wrote this because a number of people have requested several features that the <a taget="_blank" href="http://unopasscore.codeplex.com/">original version</a> did not have. The original version of this tool was downloaded around 8000 times in 2.5 years. My hope is that the new version continues to be just as popular. There really is no free alternative out there (that I know of) so hopefully this saves someone else some time and money.

Expand All @@ -14,32 +16,33 @@ PassCore does not require any configuration, as it obtains the principal context
PassCore has the following features:
- Easily localizable (i.e. you can customize all of the strings in the UI -- see the section on Customization)
- Supports <a href="https://www.google.com/recaptcha/intro/index.html">reCAPTCHA</a>
- Has a built-in password meter (thanks to <a href="https://github.com/subarroca/ng-password-strength">ng-password-strength</a>)
- Has a built-in password meter
- Responsive design that works on mobiles, tablets, and desktops.

<img align="center" src="https://raw.githubusercontent.com/unosquare/passcore/master/passcore-screenshot-01.png" alt="PassCore Screenshot"></img>
<img align="center" src="https://raw.githubusercontent.com/unosquare/passcore/NetCoreSupport/preview.png"></img>

## Installation on IIS

1. Ensure the server running IIS is domain-joined. To setermine if the computer is domain-joined Go to the *Start* menu, right click on *Computer*, then select *Properties*, and make sure the *Domain* field contains the correct setting.
2. Download the latest binary release of **<a href="https://github.com/unosquare/passcore/releases/download/v2.0.2.beta.2/passcore-2.0.2.beta.2-2016-03-14.zip">PassCore 2.0.2.beta.2</a>** -- **NOTE:** Before extracting the contents of the file, please right click on it, select Properties and make sure the file is Unblocked (Click on the Unblock button at the bottom of the dialog if it is available). Then, extract the contents of the zip file to the directory where you will be serving the website from.
3. Install the **<a href="http://www.iis.net/downloads/microsoft/httpplatformhandler">HttpPlatformHandler</a>** via Web Platform Installer.
2. If you dowload the project yo need to run the fallowing command
`dotnet publish --framework net461 --output "<path>" --configuration Release`, the path is the directory where you will be serving the website from, or you can download the latest binary release of **<a href="">PassCore</a>** -- **NOTE:** Before extracting the contents of the file, please right click on it, select Properties and make sure the file is Unblocked (Click on the Unblock button at the bottom of the dialog if it is available). Then, extract the contents of the zip file to the directory where you will be serving the website from.
3. Install the **<a href="https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x#install-the-net-core-windows-server-hosting-bundle">.NET Core Windows Server Hosting bundle </a>**.
4. Go to your *IIS Manager*, Right click on *Application Pools* and select *Add Application Pool*.
5. A dialog appears. Under Name enter **PassCore Application Pool**, Under.NET CLR Version select **No Managed Code** and finally, under Managed pipeline mode select **Integrated**. Click OK after all fields have been set.
5. A dialog appears. Under Name enter **PassCore Application Pool**, Under .NET CLR Version select **No Managed Code** and finally, under Managed pipeline mode select **Integrated**. Click OK after all fields have been set.
6. Now, right click on the application pool you just created in the previous step and select *Advanced Settings ...*. Change the *Start Mode* to **AlwaysRunning**, and the *Idle Time-out (minutes)* to **0**. Click on *OK*. This will ensure PassCore stays responsive even after long periods of inactivity.
7. Back on your *IIS Manager*, right click on *Sites* and select *Add Website*
8. A dialog appears. Under *Site name*, enter **PassCore Website**. Under *Application pool* click on *Select* and ensure you select **PassCore Application Pool**. Under *Physical path*, click on the ellispsis *(...)*, navigate to the folder where you extracted PassCore and select the **wwwroot** folder. **Important:** Make sure the Physical path points to the <code>wwwroot</code> folder and not to its parent folder which is the one containing <code>approot</code>, <code>logs</code> and <code>wwwroot</code> folders.
9. Under the *Binding section* of the same dialog, configure the *Type* to be **https**, set *IP Address* to **All Unassigned**, the *Port* to **443** and the *Host name* to something like **password.yourdomain.com**. Under *SSL Certificate* select a certificate that matches the Host name you provided above. If you don't know how to install a certificate, please refer to <a href="https://www.digicert.com/ssl-certificate-installation-microsoft-iis-8.htm">SSL Certificate Install</a> in order to install a proper certificate. **Important:** Do not serve this website without an SSL certificate because requests and responses will be transmitted in cleartext and an attacker could easily retrieve these messages and collect usernames and passwords.
10. Click *OK* and navigate to https://password.yourdomain.com (the host name you previously set). If all is set then you should be able to see the PassCore tool show up in your browser. If you encountered 500 error page, then you need to refer to the *Resolving Errors* part of <a href="http://www.strathweb.com/2015/12/running-asp-net-5-website-on-iis/">Running ASP.NET websites on IIS</a>.
8. A dialog appears. Under *Site name*, enter **PassCore Website**. Under *Application pool* click on *Select* and ensure you select **PassCore Application Pool**. Under *Physical path*, click on the ellispsis *(...)*, navigate to the folder where you extracted PassCore. **Important:** Make sure the Physical path points to the <code>parent</code> folder which is the one containing the files, <code>logs</code> and <code>wwwroot</code> folders. **NOTE:** If the folder <code>logs</code> is not there you can created. To enable the logs you need to change `stdoutLogEnabled` to "true" in the `web.config` file.
9. Under the *Binding section* of the same dialog, configure the *Type* to be **https**, set *IP Address* to **All Unassigned**, the *Port* to **443** and the *Host name* to something like **password.yourdomain.com**. Under *SSL Certificate* select a certificate that matches the Host name you provided above. If you don't know how to install a certificate, please refer to <a href="https://www.digicert.com/ssl-certificate-installation-microsoft-iis-8.htm">SSL Certificate Install on IIS 8</a> or <a href="https://www.digicert.com/csr-creation-ssl-installation-iis-10.htm">SSL Certificate Install on IIS 10</a> in order to install a proper certificate. **Important:** Do not serve this website without an SSL certificate because requests and responses will be transmitted in cleartext and an attacker could easily retrieve these messages and collect usernames and passwords.
10. Click *OK* and navigate to https://password.yourdomain.com (the host name you previously set). If all is set then you should be able to see the PassCore tool show up in your browser.

## Customization and Configuration

All server-side settings and client-side settings are stored in the <code>/approot/src/Unosquare.PassCore.Web/appsettings.json</code> file.
The most relevant configuration entries are shown below. Make sure you make your changes to the <code>appsettings.json</code> file using a regular text editor like <a href="https://atom.io/">Atom</a>.
All server-side settings and client-side settings are stored in the <code>/appsettings.json</code> file.
The most relevant configuration entries are shown below. Make sure you make your changes to the <code>appsettings.json</code> file using a regular text editor like <a href="https://code.visualstudio.com">Visual Studio Code</a>.

- To enable reCAPTCHA
- reCaptcha is enable in testing mode, please change the keys to use it with your application
- Find the <code>RecaptchaPrivateKey</code> entry and enter your private key within double quotes (<code>"</code>)
- Find the <code>IsEnabled</code> entry and enter the word <code>true</code> (note this should be done _without_ double quotes)
- Find the <code>SiteKey</code> entry and enter your Site Key within double quotes (<code>"</code>)
- To change the language of the reCAPTCHA widget
- Find the <code>LanguageCode</code> entry and enter <a href="https://developers.google.com/recaptcha/docs/language">one of the options listed here</a>. By default this is set to <code>en</code>
Expand All @@ -51,10 +54,14 @@ The most relevant configuration entries are shown below. Make sure you make your
- Change them to localize or brand this utility to meet your needs

## Troubleshooting

- Please see **<a href="https://github.com/unosquare/passcore/issues/1">this post</a>** if you can't get the application to work.
- @James-LA was kinf enough to provide another set of installation instructions. Please see **<a href="https://github.com/unosquare/passcore/issues/24">this post</a>** for further details.
- If your users are having trouble changing passwords as in issues **<a href="https://github.com/unosquare/passcore/issues/8">#8</a>** or **<a href="https://github.com/unosquare/passcore/issues/9">#9</a>** then try configuring the section <code>PasswordChangeOptions</code> in the <code>/approot/src/Unosquare.PassCore.Web/appsettings.json</code> file. Here are some guidelines:
- If you find a <a href="https://stackoverflow.com/questions/45415832/http-error-500-19-in-iis-10-and-visual-studio-2017">HTTP Error 500</a> you can try
- Press Win Key+R to Open Run Window
- in the Run Window, enter "OptionalFeatures.exe"
- in the features window, Click: "Internet Information Services"
- Click: "World Wide Web Services"
- Click: "Application Development Features"
- Check the features.
- If your users are having trouble changing passwords as in issues **<a href="https://github.com/unosquare/passcore/issues/8">#8</a>** or **<a href="https://github.com/unosquare/passcore/issues/9">#9</a>** then try configuring the section <code>PasswordChangeOptions</code> in the <code>/appsettings.json</code> file. Here are some guidelines:
- Ensure <code>UseAutomaticContext</code> is set to <code>false</code>
- Ensure <code>LdapUsername</code> is set to an AD user with enough permissions to reset user passwords
- Ensure <code>LdapPassword</code> is set to the correct password for the admin user mentioned above
Expand Down
103 changes: 103 additions & 0 deletions StyleCop.Analyzers.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for StyleCop.Analyzers" Description="Code analysis rules for StyleCop.Analyzers.csproj." ToolsVersion="14.0">
<Rules AnalyzerId="AsyncUsageAnalyzers" RuleNamespace="AsyncUsageAnalyzers">
<Rule Id="UseConfigureAwait" Action="Warning" />
</Rules>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.Features" RuleNamespace="Microsoft.CodeAnalysis.CSharp.Features">
<Rule Id="IDE0003" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1305" Action="Warning" />
<Rule Id="SA1412" Action="Warning" />
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1001" Action="None" />
<Rule Id="SA1003" Action="None" />
<Rule Id="SA1009" Action="None" />
<Rule Id="SA1028" Action="None" />
<Rule Id="SA1011" Action="None" />
<Rule Id="SA1012" Action="None" />
<Rule Id="SA1013" Action="None" />
<Rule Id="SA1021" Action="None" />
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1208" Action="None" />
<Rule Id="SA1116" Action="None" />
<Rule Id="SA1121" Action="None" />
<Rule Id="SA1124" Action="None" />
<Rule Id="SA1123" Action="None" />
<Rule Id="SA1210" Action="None" />
<Rule Id="SA1308" Action="None" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1402" Action="None" />
<Rule Id="SA1501" Action="None" />
<Rule Id="SA1503" Action="None" />
<Rule Id="SA1507" Action="Error" />
<Rule Id="SA1516" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1609" Action="None" />
<Rule Id="SA1623" Action="None" />
</Rules>
</RuleSet>
14 changes: 10 additions & 4 deletions Unosquare.PassCore.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0A003964-77CA-4779-BD97-BADDD710A745}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EA980E1-D295-4E61-B2EE-29CFE1EDB2F1}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
appveyor.yml = appveyor.yml
preview.png = preview.png
README.md = README.md
StyleCop.Analyzers.ruleset = StyleCop.Analyzers.ruleset
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Unosquare.PassCore.Web", "src\Unosquare.PassCore.Web\Unosquare.PassCore.Web.xproj", "{22E2F79B-7816-4FAB-894D-112759551796}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unosquare.PassCore.Web", "src\Unosquare.PassCore.Web\Unosquare.PassCore.Web.csproj", "{22E2F79B-7816-4FAB-894D-112759551796}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -29,4 +32,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{22E2F79B-7816-4FAB-894D-112759551796} = {0A003964-77CA-4779-BD97-BADDD710A745}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {30FE6198-367B-44D3-97CC-50927E101F3E}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.0.{build}'
image: Visual Studio 2017
platform: Any CPU
install:
# Latest version of node and npm
- ps: Install-Product node 8
- npm -g install npm@latest
- set PATH=%APPDATA%\npm;%PATH%
before_build:
- dotnet restore
- node -v
- npm -v
build_script:
- dotnet build -f net461
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed passcore-screenshot-01.png
Binary file not shown.
Binary file added preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/Unosquare.PassCore.Web/.bowerrc

This file was deleted.

Loading

0 comments on commit 8aeff83

Please sign in to comment.