Skip to content

Commit

Permalink
✨ Support for Internal OAuth2 + DPoP Feature FC-829 (#119)
Browse files Browse the repository at this point in the history
* Support for Oauth2 + DPoP authorization

* Client with Dpop Auth

* method renamed, and docs updated

* Renamed  to AuthDpopSignatureBuilder

* Renamed class AuthDpopSignatureBuilder

* updated tests with DPoP authentication

* updated format

* Verify params with DPoP authentication

* file renamed

* Renamed some files

* some rename

* renamed file

* Updated Unit tests

* removed typo

* renamed setHeaders to g getHeaders

* fixed  var  name

* Refactored duplicated code
  • Loading branch information
eplazaso authored Apr 2, 2024
1 parent 2ef4d2e commit 349f076
Show file tree
Hide file tree
Showing 5 changed files with 1,198 additions and 846 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Go to your project's pom.xml file and add as dependency.
<dependency>
<groupId>com.liveperson.faas</groupId>
<artifactId>functions-client</artifactId>
<version>1.1.6</version>
<version>1.2.2</version>
</dependency>
```

Expand All @@ -35,10 +35,9 @@ FaasClient.Builder builder = new FaasWebClient.Builder(accountId);

Furthermore you have to choose a method of authorization.
Either you provide a client secret and client Id, as we use OAuth 2.0 with client credentials by default,
or you alternatively pass your own implementation of the `AuthSignatureBilder`.

* [More information on Client Credentials](https://developers.liveperson.com/liveperson-functions-external-invocations-client-credentials.html)
or you alternatively pass your own implementation of the `AuthSignatureBuilder` or `AuthDpopSignatureBuilder`.

* [More information on Client Credentials](https://developers.liveperson.com/liveperson-functions-foundations-external-invocation.html#authentication)

```java
String clientId = "clientId";
Expand All @@ -48,6 +47,9 @@ builder.withClientSecret(clientSecret);
or
AuthSignatureBuilder authSignatureBuilder = new YourAuthSignatureBuilder();
builder.withAuthSignatureBuilder(authSignatureBuider);
or // Oauth2 + DPoP (only for internal usage)
AuthDPoPSignatureBuilder authDPoPSignatureBuilder = new YourAuthDPoPSignatureBuilder();
builder.withAuthDPoPSignatureBuilder(authDPoPSignatureBuilder);
```

This is the bare minimum that has to be provided to build the client.
Expand All @@ -56,6 +58,10 @@ This is the bare minimum that has to be provided to build the client.
FaasClient faasClient = builder.build();
```

### DPoP authorization

The client supports Oauth2+DPoP authorization ONLY FOR INTERNAL USE in service-to-service. You must provide your implementation of the `AuthDPoPSignatureBuilder` during the initialization.

### Optional fields for builder

Additionally you can pass your own implementations of specific fields to the builder before building the client.
Expand Down Expand Up @@ -139,7 +145,7 @@ optionalParams.setRequestId("requestId");
### Fetching lambdas


**You have to use your own authentication method when fetching lambdas as it still relies on OAuth 1.0.**
**You have to use your own authentication method when fetching lambdas as it relies on OAuth 1.0. / Oauth 2.0 + DPoP**


<details><summary>Fetching lambdas of account</summary>
Expand Down
Loading

0 comments on commit 349f076

Please sign in to comment.