├── Angular7
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ └── img
│ │ │ ├── add_user.png
│ │ │ └── single_user.png
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── user
│ │ │ ├── user.component.ts
│ │ │ ├── user.component.html
│ │ │ ├── login
│ │ │ │ ├── login.component.html
│ │ │ │ └── login.component.ts
│ │ │ └── registration
│ │ │ │ ├── registration.component.ts
│ │ │ │ └── registration.component.html
│ │ ├── home
│ │ │ ├── home.component.html
│ │ │ └── home.component.ts
│ │ ├── auth
│ │ │ ├── auth.guard.ts
│ │ │ └── auth.interceptor.ts
│ │ ├── app-routing.module.ts
│ │ ├── app.component.spec.ts
│ │ ├── app.module.ts
│ │ └── shared
│ │ │ └── user.service.ts
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ ├── tslint.json
│ ├── main.ts
│ ├── browserslist
│ ├── test.ts
│ ├── karma.conf.js
│ ├── index.html
│ ├── styles.css
│ └── polyfills.ts
├── e2e
│ ├── src
│ │ ├── app.po.ts
│ │ └── app.e2e-spec.ts
│ ├── tsconfig.e2e.json
│ └── protractor.conf.js
├── .editorconfig
├── tsconfig.json
├── appStructure.txt
├── .gitignore
├── README.md
├── package.json
├── tslint.json
└── angular.json
├── WebAPI
├── .vs
│ ├── WebAPI
│ │ └── v15
│ │ │ ├── Server
│ │ │ └── sqlite3
│ │ │ │ ├── db.lock
│ │ │ │ ├── storage.ide
│ │ │ │ ├── storage.ide-shm
│ │ │ │ └── storage.ide-wal
│ │ │ └── .suo
│ └── config
│ │ └── applicationhost.config
├── WebAPI
│ ├── obj
│ │ ├── Debug
│ │ │ └── netcoreapp2.2
│ │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ │ │ │ ├── WebAPI.RazorAssemblyInfo.cache
│ │ │ │ ├── WebAPI.AssemblyInfoInputs.cache
│ │ │ │ ├── WebAPI.RazorTargetAssemblyInfo.cache
│ │ │ │ ├── WebAPI.csproj.CoreCompileInputs.cache
│ │ │ │ ├── WebAPI.dll
│ │ │ │ ├── WebAPI.pdb
│ │ │ │ ├── WebAPI.assets.cache
│ │ │ │ ├── WebAPI.csprojAssemblyReference.cache
│ │ │ │ ├── WebAPI.RazorAssemblyInfo.cs
│ │ │ │ ├── WebAPI.AssemblyInfo.cs
│ │ │ │ └── WebAPI.csproj.FileListAbsolute.txt
│ │ ├── WebAPI.csproj.nuget.cache
│ │ ├── WebAPI.csproj.nuget.g.targets
│ │ └── WebAPI.csproj.nuget.g.props
│ ├── bin
│ │ └── Debug
│ │ │ └── netcoreapp2.2
│ │ │ ├── WebAPI.dll
│ │ │ ├── WebAPI.pdb
│ │ │ ├── WebAPI.runtimeconfig.dev.json
│ │ │ └── WebAPI.runtimeconfig.json
│ ├── appsettings.Development.json
│ ├── Models
│ │ ├── LoginModel.cs
│ │ ├── ApplicationSettings.cs
│ │ ├── ApplicationUserModel.cs
│ │ ├── ApplicationUser.cs
│ │ └── AuthenticationContext.cs
│ ├── appsettings.json
│ ├── WebAPI.csproj
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── WebAPI.csproj.user
│ ├── Controllers
│ │ ├── UserProfileController.cs
│ │ ├── ValuesController.cs
│ │ └── ApplicationUserController.cs
│ ├── Startup.cs
│ └── Migrations
│ │ ├── AuthenticationContextModelSnapshot.cs
│ │ ├── 20190124045416_InitialCreate.Designer.cs
│ │ └── 20190124045416_InitialCreate.cs
└── WebAPI.sln
└── README.md
/Angular7/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Angular7/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WebAPI/.vs/WebAPI/v15/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Angular7/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.RazorAssemblyInfo.cache:
--------------------------------------------------------------------------------
1 | 956d135b4025f3ddc3d3abd4139e3f09fdc815fb
2 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.AssemblyInfoInputs.cache:
--------------------------------------------------------------------------------
1 | 8071d147e32d0630849d28d7010f1c7d9f5cfc82
2 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.RazorTargetAssemblyInfo.cache:
--------------------------------------------------------------------------------
1 | 425a257f2524fe85d4c5b963eb1a394a4032abc4
2 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.csproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 001a6e34bdf223b96578f3873774e0dc2f7bf45a
2 |
--------------------------------------------------------------------------------
/Angular7/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Angular7/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/Angular7/src/favicon.ico
--------------------------------------------------------------------------------
/WebAPI/.vs/WebAPI/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/.vs/WebAPI/v15/.suo
--------------------------------------------------------------------------------
/Angular7/src/assets/img/add_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/Angular7/src/assets/img/add_user.png
--------------------------------------------------------------------------------
/Angular7/src/assets/img/single_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/Angular7/src/assets/img/single_user.png
--------------------------------------------------------------------------------
/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide
--------------------------------------------------------------------------------
/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.dll
--------------------------------------------------------------------------------
/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.pdb
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.dll
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.pdb
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/WebAPI.csproj.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "dgSpecHash": "JeOXlwjAz7f1FSY4vm/+mbYwyWovdqXDKdhdmtRElVFBviQ/3rF4KQUf7B1Ost37kxqA3qoECuvUo97nwDHs8g==",
4 | "success": true
5 | }
--------------------------------------------------------------------------------
/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide-shm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide-shm
--------------------------------------------------------------------------------
/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide-wal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/.vs/WebAPI/v15/Server/sqlite3/storage.ide-wal
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.assets.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.assets.cache
--------------------------------------------------------------------------------
/WebAPI/WebAPI/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Angular7/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodAffection/JWT-Authentication-with-.Net-Core-Web-API-and-Angular-7/master/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/Angular7/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Angular7/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {
9 | title = 'Angular7';
10 | }
11 |
--------------------------------------------------------------------------------
/Angular7/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/Angular7/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.runtimeconfig.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "additionalProbingPaths": [
4 | "C:\\Users\\Shamseer\\.dotnet\\store\\|arch|\\|tfm|",
5 | "C:\\Users\\Shamseer\\.nuget\\packages",
6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
7 | ]
8 | }
9 | }
--------------------------------------------------------------------------------
/WebAPI/WebAPI/bin/Debug/netcoreapp2.2/WebAPI.runtimeconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "tfm": "netcoreapp2.2",
4 | "framework": {
5 | "name": "Microsoft.AspNetCore.App",
6 | "version": "2.2.0"
7 | },
8 | "configProperties": {
9 | "System.GC.Server": true
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Angular7/src/app/user/user.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-user',
5 | templateUrl: './user.component.html',
6 | styles: []
7 | })
8 | export class UserComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Models/LoginModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace WebAPI.Models
7 | {
8 | public class LoginModel
9 | {
10 | public string UserName { get; set; }
11 | public string Password { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Angular7/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Models/ApplicationSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace WebAPI.Models
7 | {
8 | public class ApplicationSettings
9 | {
10 | public string JWT_Secret { get; set; }
11 | public string Client_URL { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Angular7/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('workspace-project App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to Angular7!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/Angular7/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Angular7/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/Angular7/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Models/ApplicationUserModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace WebAPI.Models
7 | {
8 | public class ApplicationUserModel
9 | {
10 | public string UserName { get; set; }
11 | public string Email { get; set; }
12 | public string Password { get; set; }
13 | public string FullName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "AllowedHosts": "*",
8 | "ConnectionStrings": {
9 | "IdentityConnection": "Server=(local)\\sqlexpress; Database=UserDB; Trusted_Connection=True; MultipleActiveResultSets=True;"
10 | },
11 | "ApplicationSettings": {
12 | "JWT_Secret": "1234567890123456",
13 | "Client_URL": "http://localhost:4200"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Models/ApplicationUser.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Identity;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 |
8 | namespace WebAPI.Models
9 | {
10 | public class ApplicationUser : IdentityUser
11 | {
12 | [Column(TypeName ="nvarchar(150)")]
13 | public string FullName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Angular7/src/app/user/user.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Angular7/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "target": "es5",
13 | "typeRoots": [
14 | "node_modules/@types"
15 | ],
16 | "lib": [
17 | "es2018",
18 | "dom"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Models/AuthenticationContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2 | using Microsoft.EntityFrameworkCore;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 |
8 | namespace WebAPI.Models
9 | {
10 | public class AuthenticationContext : IdentityDbContext
11 | {
12 | public AuthenticationContext(DbContextOptions options):base(options)
13 | {
14 |
15 | }
16 |
17 | public DbSet ApplicationUsers { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Angular7/appStructure.txt:
--------------------------------------------------------------------------------
1 | ● src
2 | +---● app
3 | | +--● user
4 | | | |--user.component.ts|.html
5 | | | +--● registration
6 | | | | |--registration.component.ts|.html
7 | | | +--● login
8 | | | |--login.component.ts|.html
9 | | |
10 | | +--● home
11 | | | |--home.component.ts|.html
12 | | |
13 | | +--● shared
14 | | | |--user.service.ts
15 | | |
16 | | +--● auth
17 | | | |--auth.guard.ts
18 | | | |--auth.interceptor.ts
19 | | |
20 | | |--app.module.ts
21 | | |--app-routing.module.ts (route configs.)
22 | |
23 | |--index.html (cdn path for bootstrap)
--------------------------------------------------------------------------------
/Angular7/src/app/home/home.component.html:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | - Username : {{userDetails.userName}}
9 | - FullName : {{userDetails.fullName}}
10 | - Email : {{userDetails.email}}
11 |
12 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/WebAPI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 | InProcess
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Angular7/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | yarn-error.log
34 | testem.log
35 | /typings
36 |
37 | # System Files
38 | .DS_Store
39 | Thumbs.db
40 |
--------------------------------------------------------------------------------
/Angular7/src/app/auth/auth.guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
3 | import { Observable } from 'rxjs';
4 |
5 | @Injectable({
6 | providedIn: 'root'
7 | })
8 | export class AuthGuard implements CanActivate {
9 |
10 |
11 | constructor(private router: Router) {
12 | }
13 | canActivate(
14 | next: ActivatedRouteSnapshot,
15 | state: RouterStateSnapshot): boolean {
16 | if (localStorage.getItem('token') != null)
17 | return true;
18 | else {
19 | this.router.navigate(['/user/login']);
20 | return false;
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace WebAPI
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Angular7/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/Angular7/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/Angular7/src/app/user/login/login.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Angular7/src/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { UserService } from './../shared/user.service';
2 | import { Component, OnInit } from '@angular/core';
3 | import { Router } from '@angular/router';
4 |
5 | @Component({
6 | selector: 'app-home',
7 | templateUrl: './home.component.html',
8 | styles: []
9 | })
10 | export class HomeComponent implements OnInit {
11 | userDetails;
12 |
13 | constructor(private router: Router, private service: UserService) { }
14 |
15 | ngOnInit() {
16 | this.service.getUserProfile().subscribe(
17 | res => {
18 | this.userDetails = res;
19 | },
20 | err => {
21 | console.log(err);
22 | },
23 | );
24 | }
25 |
26 |
27 | onLogout() {
28 | localStorage.removeItem('token');
29 | this.router.navigate(['/user/login']);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Angular7/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:54277",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "IIS Express": {
13 | "commandName": "IISExpress",
14 | "launchBrowser": true,
15 | "launchUrl": "api/values",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "WebAPI": {
21 | "commandName": "Project",
22 | "launchBrowser": true,
23 | "launchUrl": "api/values",
24 | "applicationUrl": "http://localhost:5000",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/WebAPI/WebAPI/WebAPI.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ApiControllerEmptyScaffolder
5 | root/Controller
6 | 600
7 | True
8 | False
9 | True
10 |
11 | False
12 |
13 |
--------------------------------------------------------------------------------
/Angular7/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { AuthGuard } from './auth/auth.guard';
2 | import { NgModule } from '@angular/core';
3 | import { Routes, RouterModule } from '@angular/router';
4 | import { UserComponent } from './user/user.component';
5 | import { RegistrationComponent } from './user/registration/registration.component';
6 | import { LoginComponent } from './user/login/login.component';
7 | import { HomeComponent } from './home/home.component';
8 |
9 | const routes: Routes = [
10 | {path:'',redirectTo:'/user/login',pathMatch:'full'},
11 | {
12 | path: 'user', component: UserComponent,
13 | children: [
14 | { path: 'registration', component: RegistrationComponent },
15 | { path: 'login', component: LoginComponent }
16 | ]
17 | },
18 | {path:'home',component:HomeComponent,canActivate:[AuthGuard]}
19 | ];
20 |
21 | @NgModule({
22 | imports: [RouterModule.forRoot(routes)],
23 | exports: [RouterModule]
24 | })
25 | export class AppRoutingModule { }
26 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.RazorAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | using System;
12 | using System.Reflection;
13 |
14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.RelatedAssemblyAttribute("WebAPI.Views")]
15 | [assembly: Microsoft.AspNetCore.Razor.Hosting.RazorLanguageVersionAttribute("2.1")]
16 | [assembly: Microsoft.AspNetCore.Razor.Hosting.RazorConfigurationNameAttribute("MVC-2.1")]
17 | [assembly: Microsoft.AspNetCore.Razor.Hosting.RazorExtensionAssemblyNameAttribute("MVC-2.1", "Microsoft.AspNetCore.Mvc.Razor.Extensions")]
18 |
19 | // Generated by the MSBuild WriteCodeFragment class.
20 |
21 |
--------------------------------------------------------------------------------
/Angular7/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
--------------------------------------------------------------------------------
/WebAPI/WebAPI/obj/Debug/netcoreapp2.2/WebAPI.AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | using System;
12 | using System.Reflection;
13 |
14 | [assembly: System.Reflection.AssemblyCompanyAttribute("WebAPI")]
15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
18 | [assembly: System.Reflection.AssemblyProductAttribute("WebAPI")]
19 | [assembly: System.Reflection.AssemblyTitleAttribute("WebAPI")]
20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
21 |
22 | // Generated by the MSBuild WriteCodeFragment class.
23 |
24 |
--------------------------------------------------------------------------------
/Angular7/README.md:
--------------------------------------------------------------------------------
1 | # Angular7
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.3.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28 |
--------------------------------------------------------------------------------
/Angular7/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Angular7
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.168
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPI", "WebAPI\WebAPI.csproj", "{9C812401-3BB2-46E5-AB30-12C8FFC01AB5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9C812401-3BB2-46E5-AB30-12C8FFC01AB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9C812401-3BB2-46E5-AB30-12C8FFC01AB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9C812401-3BB2-46E5-AB30-12C8FFC01AB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9C812401-3BB2-46E5-AB30-12C8FFC01AB5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6AD93BD2-7189-40B5-B58D-D4E5A789B900}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/WebAPI/WebAPI/Controllers/UserProfileController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Authorization;
6 | using Microsoft.AspNetCore.Http;
7 | using Microsoft.AspNetCore.Identity;
8 | using Microsoft.AspNetCore.Mvc;
9 | using WebAPI.Models;
10 |
11 | namespace WebAPI.Controllers
12 | {
13 | [Route("api/[controller]")]
14 | [ApiController]
15 | public class UserProfileController : ControllerBase
16 | {
17 | private UserManager _userManager;
18 | public UserProfileController(UserManager userManager)
19 | {
20 | _userManager = userManager;
21 | }
22 |
23 | [HttpGet]
24 | [Authorize]
25 | //GET : /api/UserProfile
26 | public async Task