Starts in:
1 DAY
21 HRS
1 MIN
7 SEC
Starts in:
1 D
21 H
1 M
7 S
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 November 20, 2024, 13:06