{"id":22591536,"url":"https://github.com/netsells/swift-oauth-client","last_synced_at":"2025-03-28T18:25:58.433Z","repository":{"id":43293082,"uuid":"362727610","full_name":"netsells/swift-oauth-client","owner":"netsells","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-09T15:19:50.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-02T18:52:00.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/netsells.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-29T07:26:09.000Z","updated_at":"2021-10-19T13:40:25.000Z","dependencies_parsed_at":"2022-08-31T14:21:57.774Z","dependency_job_id":null,"html_url":"https://github.com/netsells/swift-oauth-client","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fswift-oauth-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fswift-oauth-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fswift-oauth-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netsells%2Fswift-oauth-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netsells","download_url":"https://codeload.github.com/netsells/swift-oauth-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246078418,"owners_count":20720148,"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":[],"created_at":"2024-12-08T09:13:01.366Z","updated_at":"2025-03-28T18:25:58.402Z","avatar_url":"https://github.com/netsells.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuthClient\n\nAn opinionated OAuthClient for authenticating to a Laravel Passport protected API.\n\n## Requirements\n\n* iOS 13+\n* Swift 5\n\n## Contributing\nPlease make a PR and once merged, a release will be tagged with the correct version number\n\n## Default Supported Grants\n* Client Credentials\n* Password\n* Refresh\n\n### Custom Grant Types\nIts entirely possible to use custom grant types with this package. Simply use the custom grant type and pass in the desired paramteres\n\n## Using OAuthClient\n\n```swift\nlet connectionBuilder = {\n    OAuthServerConnection(url: URL(string: \"https://test.com\")!,\n                          clientID: \"1\",\n                          clientSecret: \"abcdef\")\n}\n                                       \nlet client = OAuthClient(connectionBuilder: connectionBuilder)\n\nclient.requestToken(for: .clientCredentials) { (result) in\n    switch result {\n    case.success(let token):\n        // Do something\n    case .failure(let error):\n        // Handle error\n    }\n}\n```\n\n```swift\nlet connectionBuilder = {\n    OAuthServerConnection(url: URL(string: \"https://test.com\")!,\n                          clientID: \"1\",\n                          clientSecret: \"abcdef\")\n}\n                                       \nlet client = OAuthClient(connectionBuilder: connectionBuilder)\n\nclient.fetchStoredToken(type: .clientCredentials) { (result) in\n    switch result {\n    case .success(let token):\n        // Do something with the token\n    case .failure(let error):\n        // Handle failure\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsells%2Fswift-oauth-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetsells%2Fswift-oauth-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetsells%2Fswift-oauth-client/lists"}