Base solution for your next web application

Activities of "cmthomps"

Answer

Thank you. I'm seeing the same result with Azure OpenId Connect GetExternalLoginInfoAsync returns null but I see similar cookies to the screenshot in my previous post.

Answer

One more piece of information, after I get the null result in my previous post. The application redirects to login. When I look at the cookies, I see what is in the attached image. Something is coming back from the OpenId Connect server. Just not sure where the issue is.

Answer

I've tried another OpenId server. With both Okta and Auth0, in the ExternalLoginCallback method in the AccountController this line of code come back with a null result. Google works. But any of the openId connect servers I've tried doesn't.

var externalLoginInfo = await _signInManager.GetExternalLoginInfoAsync();
Answer

Same result. I had already had those same settings in my appsettings.json file (this is a core project). The openid login redirects to the proper openId authority but after I login, I get the "invalid_grant - A redirect_uri can only be used by implicit or authorization_code grant types." error on the openid server (not in my aspnetzero project).

"OpenId": {
      "IsEnabled": "true",
      "Authority": "https://sb-auth.smarthealthit.org/",
      "ClientId": "4*******",
      "ClientSecret": "********"
    }
Question

I'm trying to integrate with an OpenId server and I'm new to the process. I've enabled the openId authentication provider in appsettings.json. When I click the openid button on the login screen it takes me to the openid server login page. After login, I see an error that says:

Error invalid_grant There was an error processing your request.

A redirect_uri can only be used by implicit or authorization_code grant types.

Does anyone know if this is an issue with how the application is configured or does this seem like a server problem? I've tried changing the AllowedGrantTypes in appsettings.json to include "implicit" and "authorization_code" but I see the same error.

Thanks, Craig

We're starting to experiment with using docker. When we try to run "docker-compose up -d", we're getting an error that says:

Pulling zero_mvc (zero/mvc:latest)... ERROR: repository zero/mvc not found: does not exist or no pull access

Should we be using a different image?

Thanks, Craig

I finally figured it out. I was trying to use an async method in the AppNotifier class. When I changed the method to be non-async, the notifications started going through. (Not just on the first pass through the service).

Thanks. Still no luck. I'm still seeing that the notification goes through the first time the service is hit but not on subsequent passes. Here is what my code looks like now. Happy to send in the project if it helps. It's a test project.

using Abp;
using Abp.Domain.Repositories;
using Abp.Domain.Uow;
using Abp.Runtime.Session;
using System.Linq;
using TestCode.TestCode.Authorization.Users;

namespace TestCode.TestCode.Notifications
{
    public class NotificationDomainService : TestCodeDomainServiceBase, INotificationDomainService
    {
        //private readonly INotificationDomainService _notificationDomainService;

        private readonly IAppNotifier _appNotifier;
        private readonly UserManager _userManager;
        private IRepository<User, long> _userRepository;
        private readonly IUnitOfWorkManager _unitOfWorkManager;
        private readonly IAbpSession _session;

        public NotificationDomainService(IAppNotifier appNotifier, IRepository<User, long> userRepository, IUnitOfWorkManager unitOfWorkManager, IAbpSession abpSession)//, UserManager userManager)
        {
            _appNotifier = appNotifier;
            //_userManager = userManager;
            _userRepository = userRepository;
            _unitOfWorkManager = unitOfWorkManager;
            _session = abpSession;
        }


        public virtual void NotifyAllForTenantById(int? tenantId, string message = "Domain Service", string severity = "info")
        {
            using (_session.Use(tenantId, null))
            {
                using (var unitOfWork = _unitOfWorkManager.Begin())
                {

                    using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))
                    {

                        var users = _userRepository.GetAllList(u => u.TenantId == tenantId);
                        //UserIdentifier[] userIds = new UserIdentifier[users.Count()];
                        int i = 0;
                        foreach (User u in users)
                        {
                            UserIdentifier userId = new UserIdentifier(tenantId, u.Id);
                            //userIds[i] = userId;
                            _appNotifier.SendMessageAsync(userId, "Hello to All Tenant Users From The Domain Service " + System.DateTime.Now.ToLongTimeString());
                        }
                        //_appNotifier.SendAlertToAllTenantUsersAsync("Hello to All Tenant Users From The Domain Service", userIds);

                        CurrentUnitOfWork.SaveChanges();
                    }

                    unitOfWork.Complete();
                }
            }
        }


    }
}

No errors. Consistently, the first time the service runs, the notification gets sent and received. After that, none of the other notifications go through. The hangfire jobs show success. Screenshot attached,

The odd thing is that sometimes the notification goes through the first time the service is hit. After that, the notifications do not go through.

Showing 61 to 70 of 88 entries