Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmcts/idam-java-client
Feign client for consuming idam's public API
https://github.com/hmcts/idam-java-client
jenkins-cft jenkins-cft-d-i
Last synced: about 1 month ago
JSON representation
Feign client for consuming idam's public API
- Host: GitHub
- URL: https://github.com/hmcts/idam-java-client
- Owner: hmcts
- License: mit
- Created: 2018-09-18T08:50:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T10:13:42.000Z (about 2 months ago)
- Last Synced: 2024-10-29T12:16:38.252Z (about 2 months ago)
- Topics: jenkins-cft, jenkins-cft-d-i
- Language: Java
- Size: 729 KB
- Stars: 2
- Watchers: 159
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Idam java client
[![Build Status](https://travis-ci.com/hmcts/idam-java-client.svg?branch=master)](https://travis-ci.com/hmcts/idam-java-client)
[ ![Download](https://api.bintray.com/packages/hmcts/hmcts-maven/idam-client/images/download.svg) ](https://bintray.com/hmcts/hmcts-maven/idam-client/_latestVersion)This is a client library for interacting with the idam application.
## Getting started
### Prerequisites
- [JDK 8](https://www.oracle.com/java)
## Usage
Add the library as a dependency of your project and configure the spring application to scan for Feign clients in the `uk.gov.hmcts.reform.idam` package:
```java
@EnableFeignClients(basePackages = {"uk.gov.hmcts.reform.idam"})
public class YourSpringApplication { }
```You will also need to set the spring configuration property of `idam.api.url`
Optionally if you are authenticating a user you can use provide client configuration:
```yaml
idam:
api:
url: http://localhost:8080
client:
id: client_id
secret: 123456
redirect_uri: https://localhost:3000/receiver
```A client (IdamClient) is provided for interacting with the IdamApi feign client to simplify the log in flow:
```java
@Service
class UserService {
private final IdamClient idamClient;
UserService(IdamClient idamClient) {
this.idamClient = idamClient;
}
public UserDetails authenticateUser(String username, String password) {
return idamClient.authenticateUser(username, password);
}
}```
Components provided by this library will get automatically configured in a Spring context if `idam.api.url` configuration property is defined and does not equal `false`.
## Building
The project uses [Gradle](https://gradle.org) as a build tool but you don't have install it locally since there is a
`./gradlew` wrapper script.To build project please execute the following command:
```bash
./gradlew build
```## Developing
### Coding style tests
To run all checks (including unit tests) please execute the following command:
```bash
./gradlew check
```## Versioning
We use [SemVer](http://semver.org/) for versioning.
For the versions available, see the tags on this repository.## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.