nerdishbynature/octokit.swift

Access token query parameter is deprecated

AvdLee opened this issue · 0 comments

Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated.

As mentioned by GitHub. It's no longer recommended to use this together with the GitHub API. It's recommended to change code by making use of an Authentication header instead.

For example:

let configuration = URLSessionConfiguration.default
let username = "<github_username>"
let token = "<github_access_token>"
let authorizationToken = "\(username):\(token)".data(using: .utf8)!.base64EncodedString()
configuration.httpAdditionalHeaders = ["Authorization": "Basic \(token)"]
let session = URLSession(configuration: configuration, delegate: nil, delegateQueue: nil)

Obviously, it would be nicer to integrate this into OctoKit for implementers to easily use.