Open Closed

API Scopes gives error if name is mismatched. #8707


User avatar
0
nayan.ranjane@softtech-engr.com created

Dear Support Team,
I want to give custom name for my api scope which will be different from the api resource but it gives me invalid scope error. Give me solution for this issue

  • ABP Framework version:4.2

  • UI Type MVC

  • Database System: EF Core (SQL Server)


3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello

    Can you share error and some code snippet to better assist you.

    And also please check this document it will helps you.

    Thank you.

  • User Avatar
    0

    image.pngimage.pngimage.png
    stack

    2025-01-27 16:30:06 [11:00:06 ERR] Client CIVITCORE is not allowed access to scope Civit.p1.
    2025-01-27 16:30:06 [11:00:06 ERR] Invalid scopes requested, {"ClientId": "CIVITCORE", "ClientName": "CIVITCORE", "GrantType": "client_credentials", "Scopes": null, "AuthorizationCode": "", "RefreshToken": "", "UserName": null, "AuthenticationContextReferenceClasses": null, "Tenant": null, "IdP": null, "Raw": {"client_id": "CIVITCORE", "client_secret": "REDACTED", "grant_type": "client_credentials", "tenant": "193A31E4-E8DD-8925-1A18-3A169DFEFDCC", "scope": "Civit.p1"}, "$type": "TokenRequestValidationLog"}
    2025-01-27 16:30:06 [11:00:06 INF] {"ClientId": "CIVITCORE", "ClientName": "CIVITCORE", "RedirectUri": null, "Endpoint": "Token", "SubjectId": null, "Scopes": null, "GrantType": "client_credentials", "Error": "invalid_scope", "ErrorDescription": null, "Category": "Token", "Name": "Token Issued Failure", "EventType": "Failure", "Id": 2001, "Message": null, "ActivityId": "0HN9SAR4GUCEP:00000008", "TimeStamp": "2025-01-27T11:00:06.0000000Z", "ProcessId": 1, "LocalIpAddress": "::ffff:172.17.0.2:44374", "RemoteIpAddress": "::ffff:172.17.0.1", "$type": "TokenIssuedFailureEvent"}
    2025-01-27 16:30:06 [11:00:06 INF] Request finished HTTP/1.1 POST https://192.168.4.237:44374/connect/token application/x-www-form-urlencoded 132 - 400 - application/json;+charset=UTF-8 23.8006ms

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello

    Can you provide steps to reproudce this issue

    Thank you.

Made with ❤️ on ABP v9.2.0-preview. Updated on January 23, 2025, 12:17