-
Notifications
You must be signed in to change notification settings - Fork 8
Tutorial
This is where you start if you are at the beginning of your journey in the NET Core world. More specific, this is a tutorial for setting up the auth-sso application locally.
PS: you're current environment should be on Windows 8, 8.1 or 10 for this tutorial :)
- Follow the instructions here
- Download current NET Core
- Go here
- Download
.NET Core 1.1 SDK - Installer
for Windows x64 or x86
If you haven't worked with these databases before, I recommend that you should start with XAMPP.
If you haven't worked with Git, you need:
- Shell:Git for windows
- GUI: SourceTree So, consider the fact that you will have two "git" apps installed. Work only from one (command line or GUI) otherwise it will start to be very complicated.
Personally, I work with:
- Command line (checkout, branch, status, pull) + cmder instead of
windows command prompt
- MS Visual Studio (add, commit, push, view file history, conflict editor)
If you are new to git
, here are some concepts & tutorials:
- http://rogerdudler.github.io/git-guide/
- https://githowto.com/
- https://about.gitlab.com/2014/09/29/gitlab-flow/
- https://www.youtube.com/watch?v=ZDR433b0HJY&feature=youtu.be&t=21m4s
- Create a folder for
civictechro
organization (recommended path:[drive letter]:\projects\civictechro
) - Open command prompt/cmder
- Navigate to
[drive letter]:\projects\civictechro
- Now we are going to grab the sources from github:
git clone https://github.com/civictechroauth-sso.git
- Let's move inside the newly created clone from github repository:
cd auth-sso
- We're going to create a local branch called
{username}-tutorial-env
. For testing purposes, please replace{username}
with your github username:git checkout -b {alexchiraples}-tutorial-env
- When you run
git checkout -b [branch name]
git automatically moves you from master branch to your newly created branch. When you're finished with your current set of developments you'll move to a new branch and delete this one :). I'll give some examples later in this tutorial.
You're all set with configuring the environment 👍
If you don't have the latest version:
- Go back on master:
git checkout master
- Get latest version:
git pull
- Go to your branch, in this example for me it is:
git checkout alexchiraples-tutorial-env
- Update current branch with master:
git merge master
- If there are conflicts, open Visual Studio and solve the conflicts
All done with the code 📦. You should be able to open the solution in Visual Studio. Before starting the applications we still need to configure and create the database
Create a database called sso.
Nota : Pe o instanta de MariaDB (10.1.23) am fost nevoi sa creez baza de date cu urmatoarea comanda :
create database sso default CHARACTER set utf8 default COLLATE utf8_general_ci;
pentru a evita eroarea "Specified key was too long; max key length is 767 bytes" la initializarea bazei de date.
- open
XAMPP
- start
MySQL
. You need to do this every time you want to run the application - start 'Apache'
- open http://localhost/phpmyadmin
- create a new database called
sso
with no extra configuration - click
sso
database, go toPrivileges
- create a new user & pass associated to local (localhost). ex: user=ssouser, password=ssouserpass
- give permissions for this user to access only the
sso
database
- copy
[drive letter]:\projects\civictechro\auth-sso\src\GovITHub.Auth.Identity\connectionstrings.Sample.json
to[drive letter]:\projects\civictechro\auth-sso\src\GovITHub.Auth.Identity\connectionstrings.json
- update the file
connectionstrings.json
- NodeJS https://nodejs.org/en/download/
- open command prompt and run:
npm install bower -g
npm install gulp -g
By now, you have created your environment and you are ready to start the application
- open command prompt
- go to
[drive letter]:\projects\civictechro\auth-sso
- update submodule dependencies:
git submodule update --init --recursive
- restore all dotnet packages:
dotnet restore
cd src\GovITHub.Auth.Identity
npm install
bower install
dotnet run
If no error displayed, after you see "Application started. Press Ctrl+C to shut down." you can navigate to http://localhost:5000 to access IdentityServer.
- open command prompt and navigate to your repository:
cd path...
- grab latest verion
git pull
- create a new local branch
git checkout -b ...
- restore nuget packages in IdentityServer folder:
dotnet restore
- run the application:
dotnet run
dotnet run
= compile
+ run application
References:
- https://github.com/civictechro/auth-sso.git - auth-sso home project
- https://www.microsoft.com/net/download/core - NET Core SDK & Tooling
- http://juristr.com/blog/2013/04/git-explained/ - Git explained for beginners
- https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db - tutorial for entity framework (ef) in .net core
- https://www.npmjs.com/ - npm is the package manager for javascript
- Quickstarts
- Configuration
- Documentation