Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "efijeremiah"

Hi there,

i've upgraded the nugets in my MVC5+Angular 1.x template project from 1.5.1 to 2.0.0 and go errors. some related to interface changes that i think i've figured it out. but this error stuck me from getting any progress in compiling the solution:

cannot convert from 'void' to 'Microsoft.AspNet.Identity.IdentityResult' TenantManager.cs 80 Active

your asap advice would be deeply appreciated

Hi there,

can you please provide an example/update for retrieving additional data from user profile when they register via facebook/google.

basically i need to update and display their profile image on the ASPNETZERO website

Appreciate it, Efi.

Hi There,

the framework allow users to register and login in:

  1. normal application registration/login (filling up the details)
  2. social login

but when i'm trying to use the 2nd method (social login via google/facebook): I can register/login, when i close the browser and open it again, i need to login again and it's bad experience for the user.

When i use the 1st method (normal application registration/login) all scenario's work just fine, and the cookie is persistence.

need your quick advice/fix how to persist the cookie for the social login scenario?

Thanks Efi.

all the url's links in your reply are broken

Alternatively, the last option i had in mind is to use the ApplicationCookie as it's configured originally on Startup.cs and call from another client (postman for example) to the WebApi just like you do with the bearer. But in this case, i keep getting the same error that the user is not logged in. even though i've tried to play with the Cookie parameters on Postman and made my Cookie persistence by editing:

        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/Account/Login"),
            ExpireTimeSpan = TimeSpan.FromDays(100000.0) //HAS TO BE A DECIMAL VALUE. IF NOT, WILL NOT WORK!
        });

As previously noted, I prefer working all the way with bearer on all client applications. But in the current situation please you advice how can i access the GetUsers for example using Cookie instead of bearer ?

the scenario i'm facing is as follows: i have several client applications including: Chrome extension, firefox extension, the web application and future mobile application

On the Chrome extension i need to use the Web Application screens for Login/External Login/Register/Password Reset etc..therefore i need 1 method for login/register/prefor webAPI calls. from what i read and know Bearer is the right way to go.

currently i can use the WebAPI perfectly using bearer but only for login (no register/external login methods). I tried what you've suggested and as expected the Web app doesn't work anymore. After day of trial and error no luck, the closest i got is through this post: <a class="postlink" href="http://stackoverflow.com/questions/23262471/use-owin-ws-federation-package-to-authenticate-against-adfs-3-0">http://stackoverflow.com/questions/2326 ... t-adfs-3-0</a>

adding JUST this line at the beginning of the Configuration method: app.SetDefaultSignInAsAuthenticationType(DefaultAuthenticationTypes.ExternalBearer);

that allowed me to read the login page but after logging in - i got an unauthorized message.

Please your quick help :oops:

Hi there,

Thanks for your quick responses on my previous questions. In the template there are 2 projects:

  1. .WebApi
  2. .Web

currently the situation is that : .Web project uses Cookie Token and .WebApi uses ExternalBearer Token

its configured under Startup.cs file. I need all my client application weather its the .Web application and other client application that i write to work with ExternalBearer cause that's the right way to go.

I've tried to edit Startup.cs file to support that as follows..i'm getting the the ExternalBearer after the call but the when i try to preform an Authorized API call with the ExternalBearer Token i got i'm getting an error message that the "User is not logged in", please your asap advice what am i doing wrong:

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseOAuthBearerAuthentication(AccountController.OAuthBearerOptions);

        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            //AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            AuthenticationType = DefaultAuthenticationTypes.ExternalBearer,
            LoginPath = new PathString("/Account/Login")
        });

        //app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
        app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalBearer);

        if (IsTrue("ExternalAuth.Facebook.IsEnabled"))
        {
            app.UseFacebookAuthentication(CreateFacebookAuthOptions());                
        }

        if (IsTrue("ExternalAuth.Twitter.IsEnabled"))
        {
            app.UseTwitterAuthentication(CreateTwitterAuthOptions());                
        }

        if (IsTrue("ExternalAuth.Google.IsEnabled"))
        {
            app.UseGoogleAuthentication(CreateGoogleAuthOptions());                
        }
    }

    private static FacebookAuthenticationOptions CreateFacebookAuthOptions()
    {
        var options = new FacebookAuthenticationOptions
        {
            AppId = ConfigurationManager.AppSettings["ExternalAuth.Facebook.AppId"],
            AppSecret = ConfigurationManager.AppSettings["ExternalAuth.Facebook.AppSecret"]
        };

        options.Scope.Add("email");
        options.Scope.Add("public_profile");

        return options;
    }

    private static TwitterAuthenticationOptions CreateTwitterAuthOptions()
    {
        return new TwitterAuthenticationOptions
        {
            ConsumerKey = ConfigurationManager.AppSettings["ExternalAuth.Twitter.ConsumerKey"],
            ConsumerSecret = ConfigurationManager.AppSettings["ExternalAuth.Twitter.ConsumerSecret"]
        };
    }

    private static GoogleOAuth2AuthenticationOptions CreateGoogleAuthOptions()
    {
        return new GoogleOAuth2AuthenticationOptions
        {
            ClientId = ConfigurationManager.AppSettings["ExternalAuth.Google.ClientId"],
            ClientSecret = ConfigurationManager.AppSettings["ExternalAuth.Google.ClientSecret"]
        };
    }

    private static bool IsTrue(string appSettingName)
    {
        return string.Equals(
            ConfigurationManager.AppSettings[appSettingName], 
            "true",
            StringComparison.InvariantCultureIgnoreCase);
    }
}

I tried and still having difficulties to sort my way out of it. :oops: I have a console application the needs to get list of users, I would appreciate you share a short example / just the source code would be good

Hi there,

i'm using your template over MySql. works just perfect. I have a huge table (10 million records) and i want to create a webpage that would allow me to browse them. Can you suggest a way or show an code example how to do pagination for such a situation?

Hi there,

i'm trying to work with the UserAppService on a side temp console application i've created. the code:

using Abp.Dependency; using Next.Ride.Authorization.Roles; using Next.Ride.Authorization.Users; using Next.Ride.Authorization.Users.Dto; using Next.Ride.Authorization.Users.Exporting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;

namespace testAbp { class Program { static void Main(string[] args) { IUserAppService userService = IocManager.Instance.Resolve<IUserAppService>(); var result = userService.GetUsers(new GetUsersInput()); } } }

Error: Additional information: No component for supporting the service Next.Ride.Authorization.Users.IUserAppService was found Question: What am i missing? can you share a simple program to show how to retrieve User and use the UserAppService independently from the web application.

Showing 1 to 10 of 10 entries