{"id":20215570,"url":"https://github.com/casdoor/casdoor-android-sdk","last_synced_at":"2025-04-10T14:38:46.231Z","repository":{"id":61494475,"uuid":"529910241","full_name":"casdoor/casdoor-android-sdk","owner":"casdoor","description":"Android SDK for Casdoor, see example at: https://github.com/casdoor/casdoor-android-example","archived":false,"fork":false,"pushed_at":"2024-07-15T15:31:43.000Z","size":99,"stargazers_count":1,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T13:11:09.598Z","etag":null,"topics":["android","auth","casdoor","java","kotlin","mobile","oauth","oidc","saml","sdk","sso"],"latest_commit_sha":null,"homepage":"https://github.com/casdoor/casdoor","language":"Kotlin","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}},"created_at":"2022-08-28T16:02:08.000Z","updated_at":"2024-07-15T15:31:47.000Z","dependencies_parsed_at":"2024-11-14T06:26:37.312Z","dependency_job_id":"cec829c2-66b3-45a6-8b09-7511895205d5","html_url":"https://github.com/casdoor/casdoor-android-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casdoor%2Fcasdoor-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casdoor","download_url":"https://codeload.github.com/casdoor/casdoor-android-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233977,"owners_count":21069493,"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":["android","auth","casdoor","java","kotlin","mobile","oauth","oidc","saml","sdk","sso"],"created_at":"2024-11-14T06:23:22.054Z","updated_at":"2025-04-10T14:38:46.202Z","avatar_url":"https://github.com/casdoor.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# casdoor-android-sdk\n\nCasdoor's SDK for Android will allow you to easily connect your application to the Casdoor\nauthentication system without having to implement it from scratch.\nCasdoor SDK is simple to use. We will show you the steps below.\n\n## Step0. Adding the dependency\n\nAdd the following dependency to your app's build.gradle file. Get latest version number from: https://mvnrepository.com/artifact/org.casbin/casdoor-android-sdk\n\n```groovy\ndependencies {\n    implementation group: 'org.casbin', name: 'casdoor-android-sdk', version: '0.0.1'\n}\n```\n\n## Step1. Init Config\n\nInitialization requires 5 parameters, which are all str type:\n| Name (in order)  | Must | Description |\n| ---------------- | ---- | --------------------------------------------------- |\n| endpoint | Yes | Casdoor Server Url, such as `https://door.casdoor.com` |\n| clientID | Yes | Application.clientID |\n| appName | Yes | Application name |\n| organizationName | Yes |Organization name |\n\n```kotlin\nval casdoorConfig = CasdoorConfig(\n   endpoint = \"https://door.casdoor.com\",\n   clientID = \"294b09fbc17f95daf2fe\",\n   redirectUri = \"casdoor://callback\",\n   organizationName = \"casbin\",\n   appName = \"app-vue-python-example\"\n)\n```\n\n## Step2. Init Casdoor\n\nThe Casdoor Contains all APIs\n\n```kotlin\nval casdoor = Casdoor(casdoorConfig)\n```\n\n## Step3. Authorize with the Casdoor server\n\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\nprovider, you cannot use request management service like Postman to send a URL\nwith parameters and get back a JSON file.\n\ncasdoor-android-sdk support the url,you can use in webview or browser to verify.\n\n```kotlin\ncasdoor.getSignInUrl()\n```\n\nHints:\n\n1. `redirect_uri` is the URL that your `APP` is configured to\n   listen to the response from `Casdoor`. For example, if your `redirect_uri`\n   is `casdoor://callback`, then Casdoor will send a request to this URL along with two\n   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\n   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.\n4. After Casdoor verification passed, it will be redirected to your `redirect_uri`,\n   like `casdoor://callback?code=xxx\u0026state=yyyy`.you can catch it and get the `code` and `state`,\n   then call `requestOauthAccessToken()` and parse out jwt token.\n\n# Example\n\nSee at: https://github.com/casdoor/casdoor-android-example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasdoor%2Fcasdoor-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasdoor%2Fcasdoor-android-sdk/lists"}