Results 1 to 1 of 1

Thread: Server is not able to validate Angular Client [IdentityServer]

  1. #1
    .NET Framework
    .NET 4.5
    Join Date
    Oct 2018
    Posts
    4
    Rep Power
    0

    Server is not able to validate Angular Client [IdentityServer]

    So I have the following setup:

    Frontend: AngularJS App

    Backend: WebApi with Identity Server to validate clients

    In my Backend I create a new in-memory client like so:

    Code:
    new Client
    {
        Enabled = true,
        ClientId = "myapp.mycompany",
        ClientUri = "https://myapp.mycompany.com",
        ClientName = "My Client",
        Flow = Flows.Implicit,
        AllowAccessToAllScopes = true,
        IdentityTokenLifetime = 300,
        AccessTokenLifetime = 3600,
        RequireConsent = false,
        RedirectUris = new List<string>
        {
             "https://myapp.mycompany.com/assets/idSrv/callback.html",
             "https://myapp.mycompany.com/assets/idSrv/silentrefreshframe.html"
        },
        PostLogoutRedirectUris = new List<string>
        {
              "https://myapp.mycompany.com/index.html"
        }
    },
    In my front-end I have the following code that declares the client, I use the oidc-token-manager.js client

    var authority = 'https://sts.mycompany.com/identity';

    Code:
        return {
            baseUri: protocol,
            tokenConfig: {
            'client_id': 'myapp.mycompany',
            'authority': authority,
            'redirect_uri': 'https://myapp.mycompany.com/assets/idSrv/callback.html',
            'post_logout_redirect_uri': 'https://myapp.mycompany.com/index.html',
            'response_type': 'id_token token',
            'scope': 'openid profile roleScope webApiScope',
            'silent_redirect_uri': 'https://myapp.mycompany.com/assets/idSrv/silentrefreshframe.html',
            'silent_renew': true
        },
        isDebugging: isDebugging
    };
    When I try to access my website at:

    http://myapp.mycompany.com

    I get the following error:

    > The client application is not known or is not authorized.

    I have enabled logging, this is what I get:

    Code:
        "Unknown client or not enabled: myapp.mycompany"
         "{
             "RedirectUri": "https://myapp.mycompany.com/assets/idSrv/callback.html",
             "SubjectId": "unknown",
             "Flow": "AuthorizationCode",
             "RequestedScopes": "",
             "Raw": {
                "state": "18141519257414835",
                "nonce": "8585758378803323",
                "client_id": "myapp.mycompany",
                "redirect_uri": "https://myapp.mycompany.com/assets/idSrv/callback.html",
                "response_type": "id_token token",
                "scope": "openid profile roleScope webApiScope"
          }
        }"
    
    End authorize request
        3001: "Endpoint failure" / "Endpoints" (Failure), Context:  EventContext { ..., Details: EndpointDetail { EndpointName: "authorize"  }C# .NET: Server is not able to validate Angular Client [IdentityServer]
    Last edited by SkyFallDev2018; 10-28-2018 at 3:08 PM.

Similar Threads

  1. Question The SMTP server requires a secure connection or the client was not authenticated. Th
    By priteshjoshi in forum C# General Discussion
    Replies: 1
    Last Post: 08-25-2018, 4:31 AM
  2. Client Server Architecture
    By Viper92 in forum Windows Forms
    Replies: 0
    Last Post: 01-19-2016, 5:07 AM
  3. Replies: 1
    Last Post: 09-28-2015, 6:01 PM
  4. problem in Sending data from client to server
    By ayna in forum Windows Forms
    Replies: 1
    Last Post: 08-10-2014, 12:12 AM
  5. Replies: 2
    Last Post: 08-28-2012, 11:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •