Esempio n. 1
0
        public ActionResult SignIn(string returnUrl, string state)
        {
            if (string.IsNullOrEmpty(returnUrl) || string.IsNullOrEmpty(state))
            {
                return(Redirect(Configuration.HubUrl + "/" + Tenant));
            }

            var accountProvider = (GetAccountProvider() as CustomAccountProvider) ?? GetLinkAccountAccountProvider() as CustomAccountProvider;

            int tenantId         = accountProvider.AccountProviderManager.GetAccountProviderTenant(accountProvider.AccountProviderId).TenantId;
            var customParameters = CustomAccountProviderManager.GetCustomPassedParameters(tenantId);

            return(CustomView(new CustomAccountProviderSignInViewModel()
            {
                ReturnUrl = returnUrl, State = state, CustomParameter = customParameters != null ? customParameters[0] : string.Empty
            }));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the list of claims.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="state">The state.</param>
        /// <returns>
        /// A list of claims for the user.
        /// </returns>
        /// <exception cref="ArgumentNullException">state is <c>null</c> or request is <c>null</c></exception>
        /// <exception cref="UnauthorizedAccessException">
        /// </exception>
        public Task <ICollection <Claim> > GetListOfClaimsAsync(HttpRequestBase request, string state)
        {
            if (string.IsNullOrEmpty(state))
            {
                throw new ArgumentNullException(nameof(state));
            }

            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var tenantId = AccountProviderManager.GetAccountProviderTenant(this.AccountProviderId).TenantId;
            var customPassedParameters = CustomAccountProviderManager.GetCustomPassedParameters(tenantId);

            return(Task.FromResult(CustomAccountProviderManager.CreateUserClaimSet(ConfigurationSettings as CustomAccountProviderConfiguration)));
        }