Base solution for your next web application
Open Closed

how to implement IdentityServer4 integration? #6700


User avatar
0
kalidarscope created

As my application need to login from another application automatically.


9 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    https://docs.aspnetzero.com/documents/zero/latest/Development-Guide-Core#identity-server-4-integration

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, what is your project framework abd version?

    you can configure identity server 4 in appSettings.json

    See https://github.com/aspnetzero/aspnet-zero-core/blob/1a44d5c05cb56fe8b4fe371d0082dfc84d593fac/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/appsettings.json#L66-L113

    if you want to find out the implementation, you can refer the tutorial at https://aspnetboilerplate.com/Pages/Documents/Zero/Identity-Server

  • User Avatar
    0
    kalidarscope created

    By default configuration is available in appSettings.json.

    "IdentityServer": { "IsEnabled": "false", "Authority": "http://localhost:22742/", "ApiName": "default-api", "ApiSecret": "secret", "Clients": [ { "ClientId": "client", "AllowedGrantTypes": [ "password" ], "ClientSecrets": [ { "Value": "def2edf7-5d42-4edc-a84a-30136c340e13" } ], "AllowedScopes": [ "default-api" ] }, { "ClientId": "demo", "ClientName": "MVC Client Demo", "AllowedGrantTypes": [ "hybrid", "client_credentials" ], "RequireConsent": "true", "ClientSecrets": [ { "Value": "def2edf7-5d42-4edc-a84a-30136c340e13" } ], "RedirectUris": [ "http://openidclientdemo.com:8001/signin-oidc" ], "PostLogoutRedirectUris": [ "http://openidclientdemo.com:8001/signout-callback-oidc" ], "AllowedScopes": [ "openid", "profile", "default-api" ], "AllowOfflineAccess": "true" } ] },

    could you share the working sample

  • User Avatar
    0
    ismcagdas created
    Support Team

    As my application need to login from another application automatically.

    Hi @kalidarscope

    Could you explain this a bit more detailed ? Is both apps (your app and the other app) AspNet Zero apps ?

  • User Avatar
    0
    kalidarscope created

    Hi @ismcagdas Thanks for your response.

    My both applications are not in ASPNET ZERO apps. my another one is a CPQ application. I require to login and view my ASPNET ZERO app automatically.

  • User Avatar
    0
    kalidarscope created

    Hi @ismcagdas,

    We have the CPQ application and ASP.NET Zero application. We have to login from CPQ to ASP.NET zero application without password authentication.

    Notes: In our CPQ application we have the option to login into CPQ with password authentication. They are maintaining some keys in their portal, we can use that to encrypt the username from our application. After we encrpt we could pass the username, domain and encrypted value in url. It will not ask any authentication to login. It will login into CPQ application without password authentication.

    Same way it could possible to login into ASP.NET zero application without password authentication.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @kalidarscope

    This scenario is not related to Identity Server. We have implemented something similar between AspNet Zero's Public website and Angular app (also with MVC & JQuery app if you want to use that).

    You can check its flow and implement something similar in your app. You don't have to use Identity Server in this scenario.

  • User Avatar
    0
    kalidarscope created

    Could you please the share the link to follow? I have tried to pass the encrypted value in url but it is redirect to login page. Is it possible to process the url we call, without redirect to login?

  • User Avatar
    0
    ismcagdas created
    Support Team