Thanks!
We ended up adding the below css to src/angular/src/styles.css to fix this issue.
.swal2-popup.swal2-toast {
padding: 12px 16px 12px 0px !important;
}
Thanks for the tip, but it didn't work. Here is the error I get in the logs after making the suggested change.
No property or field 'Id' exists in type 'GetDocumentForView' (at index 0)
I was able to solve this with the following workaround. It looks like LINQ doesn't like the ObjectMapper.Map usage. Here is the original GetAll method for Documents.
public async Task<PagedResultDto<GetDocumentForView>> GetAll(GetAllDocumentsInput input)
{
var filteredDocuments = _documentRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false)
.WhereIf(input.MinStatusFilter != null, e => e.Status >= input.MinStatusFilter)
.WhereIf(input.MaxStatusFilter != null, e => e.Status <= input.MaxStatusFilter);
var query = from o in filteredDocuments
select new GetDocumentForView()
{
Document = ObjectMapper.Map<DocumentDto>(o)
};
var totalCount = await query.CountAsync();
var documents = await query
.OrderBy(input.Sorting ?? "document.id asc")
.PageBy(input)
.ToListAsync();
return new PagedResultDto<GetDocumentForView>(
totalCount,
documents
);
}
Once I replaced the ObjectMapper code with a DTO construction specific to the Document entity, the LINQ to SQL translation went through. So instead of doing this...
var query = from o in filteredDocuments
select new GetDocumentForView()
{
Document = ObjectMapper.Map<DocumentDto>(o)
};
...I did this...
var query = from o in filteredDocuments
select new GetDocumentForView()
{
Document = new DocumentDto()
{
Id = o.Id,
Status = o.Status
}
};
This seems to work just fine, but it does require more code.
Is there a better way to do this that I am not seeing?
I figured it out. Finally.
I wrongly assumed that the OpenID Connect configuration document would be retrieved from...
https://login.microsoftonline.com/<tenantid>/.well-known/openid-configuration
...when in fact it was coming from...
https://sts.windows.net/<tenantid>/.well-known/openid-configuration
...instead.
A quick curl from within the running host container revealed that a self-signed certificate was found in the certificate chain. This makes sense because our corporate network environment does some SSL interception. The docker container doesn't have this certificate by default, but my docker host OS (Windows 10) does. I browsed to the config url with Chrome and exported the root certificate from the certificate path as a 'Base-64 encoded X.509 (.CER)' file. I set the extension to 'crt', and edited the Host Dockerfile like so...
FROM microsoft/dotnet:2.1-aspnetcore-runtime
COPY RootCA.crt /usr/local/share/ca-certificates
RUN update-ca-certificates
...
Now the certificate is added to the container and the document can be retrieved.
Same here: "Sorry but you are not permitted to use the search system."
Indeed. I have since tried using Windows containers instead of Linux containers and have run into a new error.
System.DllNotFoundException: Unable to load DLL 'activeds.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.DirectoryServices.Interop.UnsafeNativeMethods.IntADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
at System.DirectoryServices.Interop.UnsafeNativeMethods.ADsOpenObject(String path, String userName, String password, Int32 flags, Guid& iid, Object& ppObject)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()
at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)
at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue)
at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, String identityValue)
at Abp.Zero.Ldap.Authentication.LdapAuthenticationSource`2.UpdateUserAsync(TUser user, TTenant tenant)
at Abp.Authorization.AbpLogInManager`3.TryLoginFromExternalAuthenticationSources(String userNameOrEmailAddress, String plainPassword, TTenant tenant)
at Abp.Authorization.AbpLogInManager`3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Authorization.AbpLogInManager`3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task`1 actualReturnValue, Func`1 postAction, Action`1 finalAction)
at Stantec.DocView.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName)
at Stantec.DocView.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model)
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
My Dockerfile looks like this now too:
FROM microsoft/dotnet:2.1-runtime
WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "Stantec.DocView.Web.Host.dll"]
I ran the base image (ie. microsoft/dotnet:2.1-runtime) and checked C:\Windows\System32 for activeds.dll -- it was not there. If I run the 'microsoft/dotnet-framework:4.7.2-runtime' image, activeds.dll exists, but this image is quite large (8.61 GB compared to 401 MB for the 'microsoft/dotnet:2.1-runtime' image).
So I am guessing that my current error would disappear if I used the dotnet-framework image, but is that the best/only solution I have here?
What would be nice is to have an image like microsoft/dotnet:2.1-runtime that included activeds.dll...
Thanks for confirming.
Is there somewhere I can go to see the current road map?
Thanks! I had to make a few changes, so this is how I did it.
"angular\src\account\login\login.component.ts"
class LoginComponent {
ngOnInit() {
this.loginService.authenticateModel.userNameOrEmailAddress = 'foo';
this.loginService.authenticateModel.password = 'bar';
this.login();
}
}
"aspnet-core\src\ProjectName.Core\Authentication\AlwaysTrue\AlwaysTrueExternalAuthSource.cs"
public class AlwaysTrueExternalAuthSource: DefaultExternalAuthenticationSource<Tenant, User>, ITransientDependency
{
public override string Name => "AlwaysTrueExternalAuthSource";
public override Task<bool> TryAuthenticateAsync(string userNameOrEmailAddress, string plainPassword, Tenant tenant)
{
return Task.FromResult(true);
}
}
"aspnet-core\src\ProjectName.Core\ProjectNameCoreModule.cs"
public class ProjectNameCoreModule : AbpModule
{
public override void PreInitialize()
{
Configuration.Modules.Zero().UserManagement.ExternalAuthenticationSources.Add<AlwaysTrueExternalAuthSource>();
}
}
"aspnet-core\src\ProjectName.Web.Core\Controllers\TokenAuthController.cs"
public class TokenAuthController : ProjectNameControllerBase
{
[HttpPost]
public async Task<AuthenticateResultModel> Authenticate([FromBody] AuthenticateModel model)
{
var windowsIdentity = WindowsIdentity.GetCurrent();
model.UserNameOrEmailAddress = windowsIdentity.Name.ToLowerInvariant().Replace("\\","");
var loginResult = await GetLoginResultAsync(...)
}
}