Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 03c669f

Browse files
committed
Restore support for OSIAM 2.x
We only want to maintain a single version of the connector by now, so old behavior must be restored. This adds the old methods back and integrates them with the new way of connecting to OSIAM.
1 parent 6b7b6ea commit 03c669f

File tree

7 files changed

+329
-82
lines changed

7 files changed

+329
-82
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
Please, see [Create an OSIAM connector](docs/create-osiam-connector.md#legacy-schemas),
1212
if you use an OSIAM version <= 2.3.
1313

14+
- Restore support for OSIAM 2.x
15+
16+
### Changes
17+
18+
- `OsiamConnector#setMaxConnections(int maxConnections)` will also set
19+
the maximum connections per route to the given value.
20+
1421
## 1.7 - 2015-09-11
1522

1623
### Changes

docs/create-osiam-connector.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,51 @@ To be able to log in, and create or change users or groups you need to create
22
an `org.osiam.client.connector.OsiamConnector` instance. You can do this by
33
using the `OsiamConnector.Builder()` class.
44

5+
## OSIAM 3.x
6+
7+
In OSIAM 3.x auth-server and resource-server have been merged to create a better
8+
user experience. Thus you have to provide only 1 endpoint for the Connector to
9+
connect to OSIAM:
10+
11+
512
```java
613
OsiamConnector osiamConnector = new OsiamConnector.Builder()
7-
.setEndpoint(OSIAM_ENDPOINT)
14+
.withEndpoint(OSIAM_ENDPOINT)
815
.setClientId(CLIENT_ID)
916
.setClientSecret(CLIENT_SECRET)
1017
.build();
1118
```
1219

20+
## OSIAM 2.x
21+
22+
OSIAM consists of 2 servers, namely auth-server and resource-server. Therefore
23+
you have to provide 2 endpoints for the Connector to connect to OSIAM:
24+
25+
```java
26+
OsiamConnector osiamConnector = new OsiamConnector.Builder()
27+
.setAuthServerEndpoint(AUTH_ENDPOINT_ADDRESS)
28+
.setResourceServerEndpoint(RESOURCE_ENDPOINT_ADDRESS)
29+
.setClientId(CLIENT_ID)
30+
.setClientSecret(CLIENT_SECRET)
31+
.build();
32+
```
33+
34+
In case your auth and resource server are located at the same location and
35+
follow the specified naming convention you can also use:
36+
37+
```java
38+
OsiamConnector osiamConnector = new OsiamConnector.Builder()
39+
.setEndpoint(OSIAM_ENDPOINT)
40+
.setClientId(CLIENT_ID)
41+
.setClientSecret(CLIENT_SECRET)
42+
.build();
43+
```
44+
45+
This will append the default context roots to the given endpoint:
46+
47+
- auth-server: `/osiam-auth-server`
48+
- resource-server: `/osiam-resource-server`
49+
1350
## Timeouts
1451

1552
Starting with version 1.4 you can also set the connect and read timeouts

docs/login-and-getting-an-access-token.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ With **new Scope("your scope");** you can also create and add your own scopes th
2626
# Retrieving an access token
2727

2828
In a trusted environment getting an access token from OSIAM implies a successful
29-
login of the user.
29+
login of the user.
3030

3131
## [Authorization Code Grant](https://github.com/osiam/osiam/blob/master/docs/api_documentation.md#authorization-code-grant)
3232

@@ -73,7 +73,7 @@ AccessToken the following way
7373

7474
AccessToken accessToken = new AccessToken.Builder(<token>).build();
7575

76-
## [Resource Owner Password Credentials Grant](https://github.com/osiam/osiam/blob/master/docs/api_documentation.md#resource-owner-password-credentials-grant)
76+
## [Resource Owner Password Credentials Grant](https://github.com/osiam/osiam/blob/master/docs/api_documentation.md#resource-owner-password-credentials-grant)
7777
and
7878
## [Client Credentials Grant](https://github.com/osiam/osiam/blob/master/docs/api_documentation.md#client-credentials-grant)
7979

docs/vertx-example.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public class Main {
2626

2727
{
2828
oConnector = new OsiamConnector.Builder()
29-
.setEndpoint("http://localhost:8180/osiam")
29+
// OSIAM 3.x
30+
.withEndpoint("http://localhost:8080/osiam")
31+
// OSIAM 2.x
32+
.setEndpoint("http://localhost:8080")
3033
.setClientId("example-client")
3134
.setClientSecret("secret")
3235
.setClientRedirectUri("http://localhost:5000/oauth2")

0 commit comments

Comments
 (0)