Guest has no access to system

We have two origam apps. The one that throws this error takes user authorization from the first app. In DB there are BusinessPartners with our users, in OrigamUser there are only admin users.

This is the error:

Server Error in '/skills' Application.

Uživatel guest nemá přístup do systému.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: CZ.Advantages.Asap.Security.ProfileNotFoundException: Uživatel guest nemá přístup do systému.

Source Error: 


Line 10:     string action = Resources.SignIn;
Line 11:     string actionField = "Action";
Line 12:     string errorMessage = LoginHelper.Login(this, action, actionField, userNameField,
Line 13:         passwordField, languageField, secondFactorUrl, setupUrl, returnUrlField);
Line 14: }

Source File: c:\inetpub\AiraSkills\Login.cshtml    Line: 12 

Stack Trace: 


[ProfileNotFoundException: Uživatel guest nemá přístup do systému.]
   CZ.Advantages.Asap.Security.AsapProfileProvider.GetProfile(String userName) +1431
   CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId) +166
   CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery dataStructureQuery, IPrincipal principal, String transactionId) +22
   CZ.Advantages.Asap.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data) +283
   CZ.Advantages.Asap.Workflow.DataServiceAgent.Run() +1492
   CZ.Advantages.Asap.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, QueryParameterCollection parameters, DataSet currentData, String entity, String columnName) +666
   CZ.Advantages.Asap.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, String paramName1, Object paramValue1) +409
   Origam.Security.Identity.AbstractUserManager.GetBusinessPartnerDataSet(Guid methodId, String paramName, Object paramValue, String transactionId) +126
   Origam.Security.Identity.NetMembershipUserManager.MembershipUserToOrigamUser(MembershipUser membershipUser) +327
   Origam.Security.Identity.NetMembershipUserManager.FindAsync(String userName, String password) +127
   Origam.Server.Utils.LoginHelper.Login(WebPage page, String action, String actionField, String userNameField, String passwordField, String languageField, String secondFactorUrl, String setupUrl, String returnUrlField) +793
   ASP._Page_Login_cshtml.Execute() in c:\inetpub\AiraSkills\Login.cshtml:12
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +92
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +180
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +104
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +140

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0

From certain moment, it throws this error. Logging into first app is okay. If I try logging with wrong credentials it returns message Váš pokus o přihlášení se nezdařil. Zkuste to prosím znovu. With correct credentials I get the error.
When I had auth cookie I was able to login but after logout I am getting above error as well. We logging with Active Directory.

Your BusinessPartner table should contain a record with

UserName='Guest'

This is needed because e.g. data audit log has to be written under that user. There is no need to have a corresponding account created (e.g. in OrigamUser table) since nobody will actually log-in under the account. Any anonymous requests will be processed under this user (login page and anonymous API requests).

1 Like

Your answer solved my issue. Thanks a lot :slight_smile: