2019-11-07 23:51:59 +01:00
|
|
|
//
|
|
|
|
// OAuthAuthorizationClient+NetNewsWire.swift
|
2019-11-08 08:35:22 +01:00
|
|
|
// Account
|
2019-11-07 23:51:59 +01:00
|
|
|
//
|
|
|
|
// Created by Kiel Gillard on 8/11/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
2020-04-10 04:07:56 +02:00
|
|
|
import Secrets
|
2019-11-07 23:51:59 +01:00
|
|
|
|
|
|
|
extension OAuthAuthorizationClient {
|
|
|
|
|
|
|
|
static var feedlyCloudClient: OAuthAuthorizationClient {
|
|
|
|
/// Models private NetNewsWire client secrets.
|
|
|
|
/// These placeholders are substitued at build time using a Run Script phase with build settings.
|
|
|
|
/// https://developer.feedly.com/v3/auth/#authenticating-a-user-and-obtaining-an-auth-code
|
2019-11-28 00:20:09 +01:00
|
|
|
return OAuthAuthorizationClient(id: Secrets.feedlyClientId,
|
2019-11-07 23:51:59 +01:00
|
|
|
redirectUri: "netnewswire://auth/feedly",
|
|
|
|
state: nil,
|
2019-11-28 00:20:09 +01:00
|
|
|
secret: Secrets.feedlyClientSecret)
|
2019-11-07 23:51:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static var feedlySandboxClient: OAuthAuthorizationClient {
|
|
|
|
/// We use this funky redirect URI because ASWebAuthenticationSession will try to load http://localhost URLs.
|
|
|
|
/// See https://developer.feedly.com/v3/sandbox/ for more information.
|
|
|
|
/// The return value models public sandbox API values found at:
|
|
|
|
/// https://groups.google.com/forum/#!topic/feedly-cloud/WwQWMgDmOuw
|
2020-05-19 06:14:17 +02:00
|
|
|
/// They are due to expire on May 31st 2020.
|
2019-12-03 23:29:43 +01:00
|
|
|
/// Verify the sandbox URL host in the FeedlyAPICaller.API.baseUrlComponents method, too.
|
2019-11-07 23:51:59 +01:00
|
|
|
return OAuthAuthorizationClient(id: "sandbox",
|
|
|
|
redirectUri: "urn:ietf:wg:oauth:2.0:oob",
|
|
|
|
state: nil,
|
2020-05-19 06:14:17 +02:00
|
|
|
secret: "4ZfZ5DvqmJ8vKgMj")
|
2019-11-07 23:51:59 +01:00
|
|
|
}
|
|
|
|
}
|