Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to use different JSON properties in token result #711

Open
5 of 21 tasks
holgerflick opened this issue Jan 11, 2024 · 1 comment
Open
5 of 21 tasks

Trying to use different JSON properties in token result #711

holgerflick opened this issue Jan 11, 2024 · 1 comment

Comments

@holgerflick
Copy link

holgerflick commented Jan 11, 2024

Description:

I am unable to create a token POST request as the server seems to use different JSON properties than the framework. I have searched the code and I also looked into the documentation. I cannot find anything to solve this.

Instead of grant_type, they use GrantType. Is there a way to map the property names to custom names that I have missed? Error message below.

OAuth Provider? (Twitter, Github, ..):

Custom third party database which has not been released yet.

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Swift Package Manager
  • Manually

Library version:

  • head
  • v2.1.0
  • v2.0.0
  • v1.4.1
  • other: (Please fill in the version you are using.)

Xcode version:

  • 15.2

  • 11.4 (Swift 5.2)

  • 11.x (Swift 5.1)

  • 10.x (Swift 5.0)

  • other: (Please fill in the version you are using.)

  • objective c

Error Domain=OAuthSwiftError Code=400 "" UserInfo={OAuthSwiftError.response=<NSHTTPURLResponse: 0x6000002b54c0> { URL: https://.../token } { Status Code: 400, Headers {
    "Content-Length" =     (
        371
    );
    "Content-Type" =     (
        "application/json; charset=utf-8"
    );
    Date =     (
        "Thu, 11 Jan 2024 05:09:17 GMT"
    );
    Server =     (
        "Microsoft-IIS/10.0"
    );
} }, OAuthSwiftError.response.data={length = 371, bytes = 0x7b226d65 73736167 6573223a 5b7b2263 ... 223a6661 6c73657d }, Response-Body={"messages":[{"code":"BadRequest","message":"The GrantType field is required.","type":30},{"code":"BadRequest","message":"The RedirectUri field is required.","type":30},{"code":"BadRequest","message":"One of the values in field RedirectUri is not a valid url.","type":30},{"code":"BadRequest","message":"The ClientSecret field is required.","type":30}],"isSuccess":false}, NSLocalizedDescription=, Response-Headers={
    "Content-Length" = 371;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Thu, 11 Jan 2024 05:09:17 GMT";
    Server = "Microsoft-IIS/10.0";
}, NSErrorFailingURLKey=https://.../oauth/token}]
@phimage
Copy link
Member

phimage commented Jan 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants