Open Closed

Request by fiddler/Authorization #705


User avatar
0
BernardoTeixeira created
  • ABP Framework version: v3.3.1
  • DB provider: EF Core
  • **Identity Server Seperated

I want to login in Identity server and then make request in Host server. Problems I'm having cookies AspNetCore.Antiforgery and AbpAuthorization.

I capture the login request by Fiddler and try to make other request in Host using the same cookies

The response to that is

[11:13:04 INF] Authorization failed. [11:13:04 WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Authorization failed! Given policy has not granted.", "details": null, "data": null, "validationErrors": null } [11:13:04 WRN] Authorization failed! Given policy has not granted. Volo.Abp.Authorization.AbpAuthorizationException: Authorization failed! Given policy has not granted.

How can I solve my problem??


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You need to use token for authentication. Cookies are used in the Identity Server website but for apis it needs token.

  • User Avatar
    0
    BernardoTeixeira created

    Hi, how can I get the token?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi BernardoTeixeira

    You can get the access_token of the identity server website through http tools such as postman.

    https://docs.identityserver.io/en/dev/endpoints/token.html

  • User Avatar
    0
    BernardoTeixeira created

    I have the same problem

    One more question, if abp has the endpoint for login with cookies why another endpoint to get more cookies?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi BernardoTeixeira

    Invalid_client

    Please check your identity server's Client_Id

    https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json#L13

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38