{"id":20935157,"url":"https://github.com/philippheuer/credential-manager","last_synced_at":"2025-05-13T20:32:27.797Z","repository":{"id":57722071,"uuid":"153931366","full_name":"PhilippHeuer/credential-manager","owner":"PhilippHeuer","description":"Java - OAuth2 Credential Manager","archived":false,"fork":false,"pushed_at":"2025-04-26T11:43:58.000Z","size":527,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-12T02:46:59.457Z","etag":null,"topics":["credentialmanager","java","oidc-client"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilippHeuer.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":"2018-10-20T17:35:37.000Z","updated_at":"2025-04-26T11:43:59.000Z","dependencies_parsed_at":"2023-10-05T05:54:39.865Z","dependency_job_id":"64df7838-78e0-4e56-9c05-92d7a15ebe59","html_url":"https://github.com/PhilippHeuer/credential-manager","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippHeuer%2Fcredential-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippHeuer%2Fcredential-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippHeuer%2Fcredential-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippHeuer%2Fcredential-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippHeuer","download_url":"https://codeload.github.com/PhilippHeuer/credential-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254021241,"owners_count":22000890,"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":["credentialmanager","java","oidc-client"],"created_at":"2024-11-18T22:13:15.440Z","updated_at":"2025-05-13T20:32:27.374Z","avatar_url":"https://github.com/PhilippHeuer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *CredentialManager*\r\n\r\n[![MavenCentral](https://img.shields.io/maven-central/v/com.github.philippheuer.credentialmanager/credentialmanager?label=latest)](https://search.maven.org/artifact/com.github.philippheuer.credentialmanager/credentialmanager)\r\n[![Javadoc](https://javadoc.io/badge2/com.github.philippheuer.credentialmanager/credentialmanager/javadoc.svg?label=javadoc)](https://javadoc.io/doc/com.github.philippheuer.credentialmanager/credentialmanager)\r\n[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/com/github/philippheuer/credentialmanager/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/com/github/philippheuer/credentialmanager/README.md)\r\n\r\n# Description\r\n\r\nA simple OAuth Client \u0026 CredentialManager Library, that supports multiple storage backends.\r\n\r\n# Import\r\n\r\n**Gradle:**\r\n\r\n```kotlin\r\ndependencies {\r\n    implementation(\"com.github.philippheuer.credentialmanager:credentialmanager:0.3.1\")\r\n}\r\n```\r\n\r\n**Maven:**\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003ecom.github.philippheuer.credentialmanager\u003c/groupId\u003e\r\n    \u003cartifactId\u003ecredentialmanager\u003c/artifactId\u003e\r\n    \u003cversion\u003e0.3.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n# Initialization\r\n\r\n## Credential Manager\r\n\r\n```java\r\nCredentialManager credentialManager = CredentialManagerBuilder.builder()\r\n    .withStorageBackend(new TemporaryStorageBackend())\r\n    .build();\r\n```\r\n\r\n## Custom Storage Backends\r\n\r\nThis is an in-memory storage backend as an example. You can provide your own storage backend by supplying it in the builder to store/load the credentials from wherever you want.\r\n\r\n```java\r\npublic class TemporaryStorageBackend implements IStorageBackend {\r\n\r\n    /**\r\n     * Holds the Credentials\r\n     */\r\n    private List\u003cCredential\u003e credentialStorage = new ArrayList\u003c\u003e();\r\n\r\n    /**\r\n     * Load the Credentials\r\n     *\r\n     * @return List Credential\r\n     */\r\n    public List\u003cCredential\u003e loadCredentials() {\r\n        return this.credentialStorage;\r\n    }\r\n\r\n    /**\r\n     * Save the Credentials\r\n     *\r\n     * @param credentials List Credential\r\n     */\r\n    public void saveCredentials(List\u003cCredential\u003e credentials) {\r\n        this.credentialStorage = credentials;\r\n    }\r\n    \r\n    /**\r\n     * Gets a credential by user id\r\n     *\r\n     * @param userId User Id\r\n     * @return Credential\r\n     */\r\n    public Optional\u003cCredential\u003e getCredentialByUserId(String userId) {\r\n        for(Credential cred : credentialStorage) {\r\n            if (cred.getUserId().equalsIgnoreCase(userId)) {\r\n                return Optional.ofNullable(cred);\r\n            }\r\n        }\r\n\r\n        return Optional.empty();\r\n    }\r\n\r\n}\r\n```\r\n\r\n## License\r\n\r\nReleased under the [MIT License](./LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippheuer%2Fcredential-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippheuer%2Fcredential-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippheuer%2Fcredential-manager/lists"}