{"id":20215702,"url":"https://github.com/casdoor/casdoor-ios-sdk","last_synced_at":"2026-03-10T23:35:23.014Z","repository":{"id":41165947,"uuid":"450489871","full_name":"casdoor/casdoor-ios-sdk","owner":"casdoor","description":"Casdoor iOS client SDK (in Swift)","archived":false,"fork":false,"pushed_at":"2024-08-08T04:40:32.000Z","size":192,"stargazers_count":3,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T15:45:12.392Z","etag":null,"topics":["apple","authentication","casdoor","ios","jwt","oauth","objective-c","oidc","sdk","swift"],"latest_commit_sha":null,"homepage":"https://github.com/casdoor/casdoor","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casdoor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-21T12:51:56.000Z","updated_at":"2025-03-26T14:31:28.000Z","dependencies_parsed_at":"2024-01-29T00:03:07.923Z","dependency_job_id":"5870c8a8-23ec-4e23-b34c-04de73529cea","html_url":"https://github.com/casdoor/casdoor-ios-sdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/casdoor/casdoor-ios-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-ios-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-ios-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-ios-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-ios-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casdoor","download_url":"https://codeload.github.com/casdoor/casdoor-ios-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-ios-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30362121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apple","authentication","casdoor","ios","jwt","oauth","objective-c","oidc","sdk","swift"],"created_at":"2024-11-14T06:24:04.508Z","updated_at":"2026-03-10T23:35:22.996Z","avatar_url":"https://github.com/casdoor.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# casdoor-ios-sdk\nCasdoor's SDK for iOS will allow you to easily connect your application to the Casdoor authentication system without having to implement it from scratch.\nCasdoor SDK is simple to use. We will show you the steps below.\n## Step0. Adding the dependency\n```swift\n.package(url: \"https://github.com/casdoor/casdoor-ios-sdk.git\", from: \"x.x.x\")\n```\nand Casdoor dependency to your target:\n```swift\n.target(\n   name: \"MyApp\", \n   dependencies: [\n       .product(name: \"Casdoor\", package: \"casdoor-ios-sdk\")\n    ]\n ),\n```\n## Step1. Init Config\nInitialization requires 5 parameters, which are all str type:\n| Name (in order)  | Must | Description                                         |\n| ---------------- | ---- | --------------------------------------------------- |\n| endpoint         | Yes  | Casdoor Server Url, such as `http://localhost:8000` |\n| clientID         | Yes  | Application.clientID                              |\n| appName           | Yes  | Application.name                           |\n| apiEndpoint       | NO  | Casdoor Api Url, default endpoint + \"/api/\"   |\n| organizationName | Yes  |Organization name\n```swift\nlet config:CasdoorConfig = .init(\n            endpoint: \"http://localhost:8000\",\n            clientID: \"ced4d6db2f4644b85a75\",\n            organizationName: \"organization_6qvtvh\",\n            redirectUri: \"casdoor://callback\",\n            appName: \"application_y38644\",\n     )\n```\n## Step2. Init Casdoor\nThe Casdoor Contains all APIs\n```swift\nlet casdoor:Casdoor = .init(config:config)\n```\n## Step3. Authorize with the Casdoor server\nAt this point, we should use some ways to verify with the Casdoor server.  \n\nTo start, we want you understand clearly the verification process of Casdoor.\nThe following paragraphs will mention your app that wants to use Casdoor as a means\nof verification as `APP`, and Casdoor as `Casdoor`.\n`APP` will send a request to `Casdoor`. Since `Casdoor` is a UI-based OAuth\n   provider, you cannot use request management service like Postman to send a URL\n   with parameters and get back a JSON file.  \n\ncasdoor-ios-sdk support the url,you can use in webview or safariView\n```swift\ncasdoor.getSigninUrl(scope:nil,state:nil)\n```\nHints:\n1. `redirect_uri` is the URL that your `APP` is configured to\nlisten to the response from `Casdoor`. For example, if your `redirect_uri` is `casdoor://callback`, then Casdoor will send a request to this URL along with two parameters `code` and `state`, which will be used in later steps for authentication. \n2. `state` is usually your Application's name, you can find it under the `Applications` tab in `Casdoor`, and the leftmost `Name` column gives each application's name.\n3. The authorize URL allows the user to connect to a provider and give access to your application.You can use WKWebView,SFSafariViewController or ASWebAuthenticationSession if you want.\n4. After Casdoor verification passed, it will be redirected to your `redirect_uri`, like `casdoor://callback?code=xxx\u0026state=yyyy`.you can catch it and get the `code` and `state`, then call `requestOauthAccessToken(code:,state:)` and parse out jwt token. \n\n# Example\nSee at: https://github.com/casdoor/casdoor-ios-example\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-ios-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasdoor%2Fcasdoor-ios-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-ios-sdk/lists"}