{"id":21417317,"url":"https://github.com/staffbase/plugins-sdk-java","last_synced_at":"2025-07-14T04:32:54.622Z","repository":{"id":18542549,"uuid":"84566050","full_name":"Staffbase/plugins-sdk-java","owner":"Staffbase","description":"Staffbase plugins SDK for Java","archived":false,"fork":false,"pushed_at":"2024-08-01T12:00:26.000Z","size":193,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-08-01T12:52:30.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/Staffbase.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":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-10T14:07:31.000Z","updated_at":"2024-08-01T11:18:00.000Z","dependencies_parsed_at":"2024-08-01T12:41:46.732Z","dependency_job_id":"18b6d9b4-f817-4f6a-a2f5-c0a412674c2d","html_url":"https://github.com/Staffbase/plugins-sdk-java","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staffbase%2Fplugins-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staffbase%2Fplugins-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staffbase%2Fplugins-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Staffbase%2Fplugins-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Staffbase","download_url":"https://codeload.github.com/Staffbase/plugins-sdk-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225950743,"owners_count":17550309,"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-11-22T19:14:35.209Z","updated_at":"2025-07-14T04:32:54.610Z","avatar_url":"https://github.com/Staffbase.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/Staffbase/plugins-sdk-java/workflows/Continuous%20Integration/badge.svg)](https://github.com/Staffbase/plugins-sdk-java/actions)\n\n# Plugin SDK for Java\n\nIf you are developing your own plugin for your Staffbase app we describe the authentication flow of a plugin at https://developers.staffbase.com/guide/customplugin-overview/. While the official documentation covers only the conceptual aspects of the plugins – the so called Plugin SSO – we want to provide a library to help you develop your first plugin for Staffbase even faster. This SDK provides the basic functionality to parse and verify a provided token for Java.\n\n## Installation\n\nWe provide our Plugin SDK via Maven Central Repository (https://repo1.maven.org/maven2/com/staffbase/plugins-sdk-java/). Thus, you can just use maven for installation:\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.staffbase\u003c/groupId\u003e\n    \u003cartifactId\u003eplugins-sdk-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.9\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```\ndependencies {\n    implementation 'com.staffbase:plugins-sdk-java:1.2.9'\n}\n```\n\n## API Reference\n\nFor the API reference of this SDK please consult the [docs](https://staffbase.github.io/plugins-sdk-java).\n\n## Code Example\n\nYou can try to create a token from the received jwt.\n\n```java\n\timport com.staffbase.plugins.sdk.sso.SSOData;\n\timport com.staffbase.plugins.sdk.sso.SSOFacade;\n\n\t...\n\n\tString jwToken = ...\n\tRSAPublicKey rsaPublicKey = ...\n\n \ttry {\n\t\t// Create the SSO handler with your RSA public key\n\t\tfinal SSOFacade ssoFac = SSOFacade.create(rsaPublicKey);\n\n\t\t// Verify and decode the JWT token\n\t\tfinal SSOData ssoData = ssoFac.verify(jwToken);\n\t\t\n\t\t// If the plugin instance was deleted in Staffbase\n\t\tif(ssoData.isDeleteInstanceCall()){\n\t\t    this.handleSsoDeletionCall(ssoData.getInstanceID());\n\t\t    return;\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"instanceID\", ssoData.getInstanceID());\n\n\t\treturn this.forward(\"/index.jsp\");\n\n\t} catch (final SSOException ssoException) {\n\t\t\n\t\tif (logger.isErrorEnabled()) {\n\t\t\tlogger.error(\"Verification of SSO attempt failed. Aborting.\", ssoException);\n\t\t}\n\n\t\treturn this.forward(\"/errors/403-Forbidden.jsp\");\n\t}\n```\n## Contribution\n\n- Fork it\n- Create a branch `git checkout -b feature-description`\n- Put your name into authors.txt\n- Commit your changes `git commit -am \"Added ....\"`\n- Push to the branch `git push origin feature-description`\n- Open a Pull Request\n\n## Running Tests\n\nTo run the tests a simple `# mvn test` command in the root directory will suffice.\n\n## License\n\nCopyright 2017-2025 Staffbase SE.\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaffbase%2Fplugins-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaffbase%2Fplugins-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaffbase%2Fplugins-sdk-java/lists"}