Пример #1
0
        public override void Handle(FlowEvent @event, FlowContext context)
        {
            _logger.Information("SSO entered {errorStateName} with error: {errorEvent}", nameof(ErrorState), @event);

            switch (@event)
            {
            case FlowEvent.UserPrivilegeInvalid:
                ErrorCode = SsoErrorCode.MissingPrivilege;
                break;

            case FlowEvent.NoOrganizationAndRole:
                ErrorCode = SsoErrorCode.NoOrganizationAndRole;
                break;

            case FlowEvent.UnableToResolveUserInStsOrganization:
                ErrorCode = SsoErrorCode.UserNotFoundInSTS;
                break;

            case FlowEvent.UnableToLocateUser:
                ErrorCode = SsoErrorCode.UnableToCreateUserWithUnknownOrganization;
                break;

            default:
                ErrorCode = SsoErrorCode.Unknown;
                break;
            }
        }
Пример #2
0
        private RedirectResult SsoError(SsoErrorCode error)
        {
            var uriBuilder = new UriBuilder(Request.RequestUri)
            {
                Path  = "Home/SsoError",
                Query = $"ssoErrorCode={error:G}"
            };

            return(Redirect(uriBuilder.Uri));
        }