facebook / facebook/facebook-ios-sdk

Invalid OAuth access token - Cannot parse access token

Open
#2,576 3 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Swift
Stars
8.1k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist before submitting a bug report

- [x] I've updated to the latest released version of the SDK
- [x] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-ios-sdk/issues)
- [x] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [x] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [x] This issue is not security related and can safely be disclosed publicly on GitHub

### Xcode version

16.2

### Facebook iOS SDK version

18.0.0

### Dependency Manager

CocoaPods

### SDK Framework

Login

### Goals

授权登录获取到access_token后调用https://graph.facebook.com/v22.0/me接口可以获取用户信息

### Expected results

获取到access_token后可以获取到用户信息

### Actual results

现在授权登录获取到access_token后传给接口https://graph.facebook.com/v22.0/me报如下错,我看安卓和H5这个token都是EAA开头的能请求
"error": {
"message": "Invalid OAuth access token - Cannot parse access token",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "A9xnjd1iwrUx8qFJt1sld_Q"
}

### Steps to reproduce

_No response_

### Code samples & details

```swift
// INSERT YOUR CODE HERE
let loginManager = LoginManager()
loginManager
.logIn(
permissions: ["public_profile", "email"],
from: self
) { result, error in
if let error = error {
print("Encountered Erorr: \(error)")
} else if let result = result, result.isCancelled {
print("Cancelled")
} else {
print("Logged In")
let accessToken = AccessToken.current
print(accessToken?.tokenString ?? "")
if let profile = Profile.current {
let email = profile.email ?? ""
let userId = profile.userID
}

}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.