You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<5> Store the offset in the external store after processing
48
48
49
+
=== OAuth 2 Support
50
+
51
+
The client can authenticate against an OAuth 2 server like https://github.com/cloudfoundry/uaa[UAA].
52
+
It uses the https://tools.ietf.org/html/rfc6749#section-4.4[OAuth 2 Client Credentials flow].
53
+
The https://www.rabbitmq.com/docs/oauth2[OAuth 2 plugin] must be enabled on the server side and configured to use the same OAuth 2 server as the client.
54
+
55
+
How to retrieve the OAuth 2 token can be globally configured at the environment level:
56
+
57
+
.Configuring OAuth 2 token retrieval
58
+
[source,java,indent=0]
59
+
--------
60
+
include::{test-examples}/Api.java[tag=oauth2]
61
+
--------
62
+
<1> Access the OAuth 2 configuration
63
+
<2> Set the token endpoint URI
64
+
<3> Authenticate the client application
65
+
<4> Set the grant type
66
+
<5> Set optional parameters (depends on the OAuth 2 server)
67
+
<6> Set the SSL context (e.g. to verify and trust the identity of the OAuth 2 server)
68
+
<7> The token can be shared across the environment connections
69
+
70
+
The environment retrieves tokens and uses them to create AMQP connections.
71
+
It also takes care of refreshing the tokens before they expire and of re-authenticating existing connections so the broker does not close them when their token expires.
72
+
73
+
The environment uses the same token for all the connections it maintains by default, but this can be changed by setting the `shared` flag to `false`.
74
+
With `shared = false`, each connection will have its own OAuth 2 token.
75
+
76
+
The OAuth 2 configuration can be set at the environment level but also at the connection level.
77
+
49
78
=== Metrics Collection
50
79
51
80
The library provides the {javadoc-url}/com/rabbitmq/client/amqp/metrics/MetricsCollector.html[`MetricsCollector`] abstraction to collect metrics.
0 commit comments