-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from cloudscribe/vue-contrib
merge Vue sample for #2
- Loading branch information
Showing
47 changed files
with
1,300 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
OPServer/nodb_storage/projects/9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c/apiresource/api1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"ApiSecrets":[{"Description":null,"Value":"K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols=","Expiration":null,"Type":"SharedSecret"}],"Scopes":[{"Name":"api1","DisplayName":"api1","Description":"api1","Required":false,"Emphasize":false,"ShowInDiscoveryDocument":false,"UserClaims":[]}],"Enabled":true,"Name":"api1","DisplayName":"api1","Description":null,"UserClaims":["role"]} |
1 change: 1 addition & 0 deletions
1
OPServer/nodb_storage/projects/9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c/client/vuejs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Enabled":true,"ClientId":"vuejs","ProtocolType":"oidc","ClientSecrets":[],"RequireClientSecret":true,"ClientName":"vuejs","ClientUri":null,"LogoUri":null,"RequireConsent":true,"AllowRememberConsent":true,"AllowedGrantTypes":["implicit"],"RequirePkce":false,"AllowPlainTextPkce":false,"AllowAccessTokensViaBrowser":true,"RedirectUris":["http://localhost:5900"],"PostLogoutRedirectUris":["http://localhost:5900"],"FrontChannelLogoutUri":null,"FrontChannelLogoutSessionRequired":true,"BackChannelLogoutUri":null,"BackChannelLogoutSessionRequired":false,"AllowOfflineAccess":false,"AllowedScopes":["profile","openid","email","api1"],"AlwaysIncludeUserClaimsInIdToken":false,"IdentityTokenLifetime":300,"AccessTokenLifetime":3600,"AuthorizationCodeLifetime":300,"AbsoluteRefreshTokenLifetime":2592000,"SlidingRefreshTokenLifetime":1296000,"ConsentLifetime":null,"RefreshTokenUsage":0,"UpdateAccessTokenClaimsOnRefresh":false,"RefreshTokenExpiration":0,"AccessTokenType":0,"EnableLocalLogin":true,"IdentityProviderRestrictions":[],"IncludeJwtId":false,"Claims":[],"AlwaysSendClientClaims":false,"ClientClaimsPrefix":"client_","PairWiseSubjectSalt":null,"AllowedCorsOrigins":["http://localhost:5900"],"Properties":{}} |
1 change: 1 addition & 0 deletions
1
.../9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c/grantitem/9aca391e-e515-4520-9308-cf20b27750b3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"Id":"9aca391e-e515-4520-9308-cf20b27750b3","Key":"KZEUHjNwWQFSY0wB49bNJVUEvjYvUg8u9oiyXrVVrYs=","Type":"user_consent","SubjectId":"19d0f112-34ef-4266-b1b4-d9c2ead8349a","ClientId":"vuejs","CreationTime":"2018-04-16T16:02:17Z","Expiration":null,"Data":"{\"SubjectId\":\"19d0f112-34ef-4266-b1b4-d9c2ead8349a\",\"ClientId\":\"vuejs\",\"Scopes\":[\"openid\",\"profile\",\"api1\"],\"CreationTime\":\"2018-04-16T16:02:17Z\",\"Expiration\":null}"} |
2 changes: 1 addition & 1 deletion
2
...s/9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c/siteuser/19d0f112-34ef-4266-b1b4-d9c2ead8349a.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"AuthorBio":"","Comment":"","NormalizedEmail":"[email protected]","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2017-08-27T13:08:47.4368302Z","MustChangePwd":false,"PasswordHash":"AQAAAAEAACcQAAAAELsEmNPOTbhrsV8v+siQO9rtzlXkj3QvNVDtlaLZuo0XKTvKKlHx1ZCKgd/xnX4UuA==","CanAutoLockout":false,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"3687b9b5-4aed-447d-a674-cf1d5edc0a87","Signature":"","TwoFactorEnabled":false,"Id":"19d0f112-34ef-4266-b1b4-d9c2ead8349a","SiteId":"9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c","Email":"[email protected]","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","IsDeleted":false,"Trusted":false,"AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2017-08-23T19:27:35.0835603Z","LastModifiedUtc":"2017-08-23T19:27:35.0835607Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2018-04-11T19:02:49.9303707Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""} | ||
{"AuthorBio":"","Comment":"","NormalizedEmail":"[email protected]","NormalizedUserName":"ADMIN","EmailConfirmed":true,"EmailConfirmSentUtc":null,"AgreementAcceptedUtc":null,"LockoutEndDateUtc":null,"NewEmail":"","NewEmailApproved":false,"LastPasswordChangeUtc":"2017-08-27T13:08:47.4368302Z","MustChangePwd":false,"PasswordHash":"AQAAAAEAACcQAAAAELsEmNPOTbhrsV8v+siQO9rtzlXkj3QvNVDtlaLZuo0XKTvKKlHx1ZCKgd/xnX4UuA==","CanAutoLockout":false,"AccessFailedCount":0,"RolesChanged":false,"SecurityStamp":"3687b9b5-4aed-447d-a674-cf1d5edc0a87","Signature":"","TwoFactorEnabled":false,"Id":"19d0f112-34ef-4266-b1b4-d9c2ead8349a","SiteId":"9c1cd70e-455c-43e6-b7f4-bb4ed60cf70c","Email":"[email protected]","UserName":"admin","DisplayName":"Admin","FirstName":"","LastName":"","IsDeleted":false,"Trusted":false,"AvatarUrl":"","DateOfBirth":null,"CreatedUtc":"2017-08-23T19:27:35.0835603Z","LastModifiedUtc":"2017-08-23T19:27:35.0835607Z","DisplayInMemberList":true,"Gender":"","IsLockedOut":false,"LastLoginUtc":"2018-04-21T12:34:12.4164807Z","PhoneNumber":"","PhoneNumberConfirmed":false,"AccountApproved":true,"TimeZoneId":"","WebSiteUrl":""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Api.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[Authorize] | ||
public class IdentityController : ControllerBase | ||
{ | ||
|
||
public IdentityController() | ||
{ | ||
} | ||
[HttpGet()] | ||
public IActionResult Get() | ||
{ | ||
return new JsonResult(from c in User.Claims select new { c.Type, c.Value }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Api | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateWebHostBuilder(args).Build().Run(); | ||
} | ||
|
||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.UseStartup<Startup>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:5901", | ||
"sslPort": 0 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development", | ||
"ASPNETCORE_HTTPS_PORT": "5901" | ||
} | ||
}, | ||
"Api": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development", | ||
"ASPNETCORE_URLS": "http://localhost:5901" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using IdentityServer4.AccessTokenValidation; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Api | ||
{ | ||
public class Startup | ||
{ | ||
public IConfiguration Configuration { get; } | ||
public IHostingEnvironment Environment { get; } | ||
public Startup(IConfiguration configuration, IHostingEnvironment environment) | ||
{ | ||
Configuration = configuration; | ||
Environment = environment; | ||
} | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
services | ||
.AddMvcCore() | ||
.AddJsonFormatters() | ||
.AddAuthorization() | ||
; | ||
|
||
services.AddCors(); | ||
|
||
services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme) | ||
.AddIdentityServerAuthentication(options => | ||
{ | ||
options.Authority = "http://localhost:50405" ; | ||
options.RequireHttpsMetadata = false; | ||
options.ApiName = "api1"; | ||
options.ApiSecret = "secret"; | ||
}); | ||
|
||
} | ||
|
||
public void Configure(IApplicationBuilder app) | ||
{ | ||
app.UseCors(policy => | ||
{ | ||
policy.AllowAnyOrigin(); | ||
policy.AllowAnyHeader(); | ||
policy.AllowAnyMethod(); | ||
}); | ||
app.UseAuthentication(); | ||
app.UseMvc(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="wwwroot\**" /> | ||
<Content Remove="wwwroot\**" /> | ||
<EmbeddedResource Remove="wwwroot\**" /> | ||
<None Remove="wwwroot\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.3.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Warning" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"presets": ["es2015", "stage-2"], | ||
"plugins": [ | ||
"transform-runtime", | ||
"transform-async-to-generator" | ||
], | ||
"comments": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module' | ||
}, | ||
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style | ||
extends: 'standard', | ||
// required to lint *.vue files | ||
plugins: [ | ||
'html' | ||
], | ||
// add your custom rules here | ||
'rules': { | ||
// allow paren-less arrow functions | ||
'arrow-parens': 0, | ||
// allow async-await | ||
'generator-star-spacing': 0, | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 | ||
} | ||
} |
Oops, something went wrong.