{"id":15037920,"url":"https://github.com/marck100/oauth","last_synced_at":"2026-02-08T19:32:51.739Z","repository":{"id":219488139,"uuid":"287829148","full_name":"Marck100/OAuth","owner":"Marck100","description":"OAuth allows you to perform authenticate requests using OAuth 1.0 protocol.","archived":false,"fork":false,"pushed_at":"2022-02-27T11:25:03.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T10:42:33.363Z","etag":null,"topics":["api","authentication","oauth","oauth1","package","swift4","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"https://marcopilloni.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marck100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"Marck100"}},"created_at":"2020-08-15T21:42:06.000Z","updated_at":"2022-02-23T08:38:37.000Z","dependencies_parsed_at":"2024-01-27T20:50:58.489Z","dependency_job_id":null,"html_url":"https://github.com/Marck100/OAuth","commit_stats":null,"previous_names":["marck100/oauth"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/Marck100/OAuth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marck100%2FOAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marck100%2FOAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marck100%2FOAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marck100%2FOAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marck100","download_url":"https://codeload.github.com/Marck100/OAuth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marck100%2FOAuth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265798666,"owners_count":23829981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","authentication","oauth","oauth1","package","swift4","twitter","twitter-api"],"created_at":"2024-09-24T20:36:21.197Z","updated_at":"2026-02-08T19:32:51.660Z","avatar_url":"https://github.com/Marck100.png","language":"Swift","funding_links":["https://github.com/sponsors/Marck100"],"categories":[],"sub_categories":[],"readme":"# OAuth\n\nOAuth helps you authenticate your request with OAuth1 protocol.\nIt's very easy to use and needs basic information:\n- consumerKey\n- consumerSecretKey\n...\nand you can add parameters to the authorization field and more\n\n## Let's start\n\n1) Provide `consumerKey` and `consumerSecretKey`\n\n```swift\nOAuth.setConsumer(consumerKey: \"xxx\", consumerSecret: \"xxx\")\n```\n\n2) Provide `openURL`\n```swift\nOAuth.shared.openURL = { url in\n...\n}\n```\n\n3) Add callback support to your app in Targets\u003eYour main app\u003eInfo\u003eURL Types\n4) Handle callback in your app\n\n```swift\nfunc scene(_ scene: UIScene, url: URL) {\n/// This function return true if the passed url is OAuth callback\nOAuth.shared.observeURL(url: url)\n}\n```\n\n5) Login\n```\nOAuth.shared.login { success in\n    ...\n}\n```\n\n6) Generate your request\n\u003e Oauth generates most of the oauth parameters:\n\u003e - `oauth_signature_method`\n\u003e - `oauth_timestamp`\n\u003e - `oauth_nonce`\n\u003e - `oauth_version`\n\u003e - `oauth_signature`\n\nBut you can add extra parameters to the authorization header\n\n```swift\nlet url = URL(string: \"xxx\")\n\nlet request = OAuth.shared.request(url, method: .post, oauthParameters: nil, parameters: nil)\n```\n\n7)  Post your request\n\n```swift\nPostCenter.shared.post(request, completionHandler: completionHandler)\n```\n\nOauth can also remember some key information like `token`, `tokenSecret` and `verifier` which will automatically be included in the authentication header as you update them.\n\n```swift\nOAuth.shared.setToken(token: \"xxx\", tokenSecret: \"xxx\")\nOAuth.shared.setVerifier(verifier: \"xxx\")\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarck100%2Foauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarck100%2Foauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarck100%2Foauth/lists"}