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
# WHAT IS THIS FILE? | |
# This helps with loading environment values at run rime, | |
# so the configs could be injected into docker containers at run time, | |
# and we only build one image for all environments | |
#!/bin/bash | |
# Recreate config file | |
rm -rf /app/UI/build/env-config.js | |
touch /app/UI/build/env-config.js |
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
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base | |
#Add user | |
#RUN agggroup app && adduser -S -G app app | |
#USER app | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 |
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
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build | |
#Personal Access Token to Authenticate To Artifactory | |
ARG PAT |
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
services.AddIdentityCore<ApplicationUser>() | |
.AddRoles<ApplicationRole>() | |
.AddEntityFrameworkStores<IdentityDBContext>() | |
.AddSignInManager() | |
.AddTokenProvider(TokenOptions.DefaultProvider, typeof(DataProtectorTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultEmailProvider, typeof(EmailTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultPhoneProvider, typeof(PhoneNumberTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultAuthenticatorProvider, typeof(AuthenticatorTokenProvider<ApplicationUser>)); | |
services.AddAuthentication(x => |
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
<form method='POST' action={`https://api.domain.com/identity/v1/account/external-login?provider=Twitter&returnUrl=/home`} > | |
<Button | |
type="submit" | |
name='provider' | |
value='Twitter' | |
title={`Login using Twitter`}> | |
<img src='link-to-twitter-logo'} alt="" /> | |
</PageButton> | |
</form> |
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
<form method='POST' action={`https://api.domain.com/identity/v1/account/external-login?provider=Microsoft&returnUrl=/home`} > | |
<Button | |
type="submit" | |
name='provider' | |
value='Microsoft' | |
title={`Login using Microsoft`}> | |
<img src='link-to-microsoft-logo'} alt="" /> | |
Microsoft | |
</PageButton> | |
</form> |
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
services.AddIdentityCore<ApplicationUser>() | |
.AddRoles<ApplicationRole>() | |
.AddEntityFrameworkStores<IdentityDBContext>() | |
.AddSignInManager() | |
.AddTokenProvider(TokenOptions.DefaultProvider, typeof(DataProtectorTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultEmailProvider, typeof(EmailTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultPhoneProvider, typeof(PhoneNumberTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultAuthenticatorProvider, typeof(AuthenticatorTokenProvider<ApplicationUser>)); | |
services.AddAuthentication(x => |
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
services.AddIdentityCore<ApplicationUser>() | |
.AddRoles<ApplicationRole>() | |
.AddEntityFrameworkStores<IdentityDBContext>() | |
.AddSignInManager() | |
.AddTokenProvider(TokenOptions.DefaultProvider, typeof(DataProtectorTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultEmailProvider, typeof(EmailTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultPhoneProvider, typeof(PhoneNumberTokenProvider<ApplicationUser>)) | |
.AddTokenProvider(TokenOptions.DefaultAuthenticatorProvider, typeof(AuthenticatorTokenProvider<ApplicationUser>)); | |
services.AddAuthentication(x => |
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
public async Task<LoginResultViewModel> ExternalLogin(ExternalLoginInfo info) | |
{ | |
LoginResultViewModel loginResult = null; | |
if (info.IsEmpty()) | |
{ | |
return null; | |
} | |
var signinResult = await signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, 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
[HttpGet] | |
[AllowAnonymous] | |
[Route("account/external-auth-callback")] | |
public async Task<IActionResult> ExternalLoginCallback() | |
{ | |
ExternalLoginInfo info = await signInManager.GetExternalLoginInfoAsync(); | |
var result = await accountService.ExternalLogin(info); | |
if (result.IsEmpty()) |