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

Activities of "entripy"

I was working with the 6.7 framework. Regenerating from 6.9 and comparing changes, it now works.

I am struggling to enable OpenIDConnect authentication using core and Angular. I've update my appSettings files like below but can't get things to work. I've tried numerous other combinations as well with no luck.

"OpenId": { "IsEnabled": "true", "Authority": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxxxxxxx/v2.0", "ClientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "LoginUrl": "https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/authorize", },

I tried that already. its not working.

Hi, I am using following ajaz call with abp.ajax to controller.

$("#mapBtn").on("click", function (e) {
            var data = buildDataObject();
            abp.ajax({
                url: "Map",
                data: JSON.stringify({
                ColumnName1: $("#selector1").val(),
                HasHeader: $("#selector2").is("checked"),
                
            }),
                content: "application/json; charset=utf-8",
                type:'post'
            }).done(function (data) {
                abp.notify.success('Created  ');});
          
        });

My model class:

public class MyClass {
        public string ColumnName1 { get; set; }
        public bool HasHeader { get; set; }
    }

My controller action is as follows: I used [DisableValidation] on the controller.

[HttpPost]
public async Task<ActionResult> Map([FromBody] MyClass data)
        {
                       // data  is null 
            return View("Import");
        }

data is always null. When I replaced myclass with dynamic type; i do get data back but its not in a format I can convert to my model. Can you point me to what is missing?

I am working on ASP.NET Zero which is built on ASP.NET Core. I was getting a bad request error when I used KendoUI Upload control on one of my pages. After lot of research and investigation, I realized the HTTP POST Ajax request is failing with 400 bad request error. My code samples below have some commented line for other scenarios I test. None of the existing posts in stack over flow solved my issue. I Below is my ajax call:

$.ajax({ url: "/test/TestCall", type: 'Post', /* data: JSON.stringify({ "Param1": "test" }), dataType:"json", processData: false, */// tell jQuery not to process the data contentType: "application/json", // tell jQuery not to set contentType success: function (result) { var res = result; }, error: function (jqXHR) { var z = 3; }, complete: function (jqXHR, status) { var x = 10; } }); My Controller code is: I also tried without extending from MyTestProjectControllerBase and just using the Controller base class. It did not work.

public class TestController : MyTestProjectControllerBase { public IActionResult Index() { return View(); }

[HttpPost] public ActionResult TestCall() { //return Content("Name is:" ); return new ContentResult() { Content = "test" }; } } What am I missing? I tried using postman and I see this additional information 'Request cannot be fulfilled due to bad syntax'

could not figure it out after spending good 8 hours on this issue. Not sure if the issue is with Asp.net core or asp.net zero. Any pointers would be greatly appreciated.

Hi @cmthomps,

Thanks for sharing. It is working after putting the OnTicketReceived event handler in.

Thanks @cmthomps Thanks @ismcagdas

Tried to use the suggested authority. No change. Values available in Token but 'GetExternalLoginInfoAsync' returns null.

Hi ismcagdas,

unique_name was missing in the Azure AD V2 token. I switched to Azure AD V1 token and all three claims (name, unique_name and aud) have values now. But 'GetExternalLoginInfoAsync' still returns null.

Thanks, Keith

Hi ismcagdas,

I examined the id_token in the response form data from "http://localhost:62114/signin-oidc". It is an Azure AD V2 token with claim [preferred_username] value be the same as the logon name I used. Seems authenticate with Azure AD is working.

The question is why "GetExternalLoginInfoAsync" is still returning null.

Thank you.

Hi,

There are no errors in Log.txt. The followings are part of log related to the external login. The last line is the log after 'ExternalLoginCallback' return null

INFO 2018-11-06 09:52:45,580 [8 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method MyTestProject.Web.Controllers.AccountController.ExternalLogin (MyTestProject.Web.Mvc) with arguments (OpenIdConnect, /App, ) - Validation state: Valid INFO 2018-11-06 09:52:47,753 [8 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method MyTestProject.Web.Controllers.AccountController.ExternalLogin (MyTestProject.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.ChallengeResult in 2172.7945ms. INFO 2018-11-06 09:52:47,936 [8 ] Microsoft.AspNetCore.Mvc.ChallengeResult - Executing ChallengeResult with authentication schemes (OpenIdConnect). INFO 2018-11-06 09:52:49,461 [19 ] ation.OpenIdConnect.OpenIdConnectHandler - AuthenticationScheme: OpenIdConnect was challenged. INFO 2018-11-06 09:52:49,465 [19 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action MyTestProject.Web.Controllers.AccountController.ExternalLogin (MyTestProject.Web.Mvc) in 5905.7891ms INFO 2018-11-06 09:52:49,465 [19 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 6361.7538ms 302 INFO 2018-11-06 09:52:50,225 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 POST http://localhost:62114/signin-oidc application/x-www-form-urlencoded 1779 INFO 2018-11-06 09:52:53,453 [8 ] tion.Cookies.CookieAuthenticationHandler - AuthenticationScheme: Identity.External signed in. INFO 2018-11-06 09:52:53,481 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 3255.3743ms 302 INFO 2018-11-06 09:52:53,530 [4 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/Account/ExternalLoginCallback?ReturnUrl=%2FApp&authSchema=OpenIdConnect
INFO 2018-11-06 09:52:54,100 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "ExternalLoginCallback", controller = "Account", area = ""}. Executing action MyTestProject.Web.Controllers.AccountController.ExternalLoginCallback (MyTestProject.Web.Mvc) INFO 2018-11-06 09:52:54,984 [4 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method MyTestProject.Web.Controllers.AccountController.ExternalLoginCallback (MyTestProject.Web.Mvc) with arguments (/App, , ) - Validation state: Valid WARN 2018-11-06 09:53:07,779 [4 ] roject.Web.Controllers.AccountController - Could not get information from external login.

Showing 1 to 10 of 11 entries