Base solution for your next web application
Open Closed

I am having issues connecting an external app using IdentityServer. #8088


User avatar
0
Jason created

I upgraded AspNetCore Zero application to AspNetCore 3 from 2.2, and started trying to rebuild connections I had written with an external app to access certain things, including using the AspNetCore Zero application, (EXP), as a login provider, and getting and uploading Users to EXP from my external app (RXP). For the most part, I assumed any changes would be small, just adding the client again, and Api resources necessary to allow access. I am using two different kinds of approaches. For the user bits, with the GET request to EXP for the users list, and the POST back to EXP with an excel file to import users, I use a password connection to get the access token and then make the request. For the actual SSO login provision, I used code flow with PKCE. In testing out the GET request for the users, it first grabs the Discovery document from the base url of EXP, which I matched to the url specified in the appsettings.json file in EXP. I either get NotFound, or Blocked by the target, everytime I try to get it, so I don't even get to the point of initiating the access token request completely.

I am wondering what the issue may be, if anyone else has experienced this.

Here are a few code snippets that pertain directly to this:

//Users list GET reuqest
var client = new HttpClient();

            var disco = await client.GetDiscoveryDocumentAsync(ServerUrlBase);
            if (disco.IsError)
            {
                throw new Exception(disco.Error);
            }
            ...
            
            //Users excel import into EXP
            var byteArrayContent = new ByteArrayContent(data);
                   
                    var content = new MultipartFormDataContent {{byteArrayContent, "file", "UserList.xslx"}};

                    var response = await client.PostAsync($"{ServerUrlBase}Users/ImportFromExcel",content);

4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Jason

    Is the console app (/test/*.ConsoleApiClient) project works for you ?

  • User Avatar
    0
    Jason created

    Seems like it does, at least through the discovery document part. I get this error when it tries to grab the users list, after getting the access token:

  • User Avatar
    0
    maliming created
    Support Team

    I get this error when it tries to grab the users list, after getting the access token

    This is some "conflict" between jwt and identity server, you can ignore this exception.

    [x] break when this exception type is thrown

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.