@@ -68,18 +68,61 @@ public interface OAuthSettings<T> {
68
68
*/
69
69
OAuthSettings <T > grantType (String grantType );
70
70
71
+ /**
72
+ * Set a parameter to pass in the request.
73
+ *
74
+ * <p>The OAuth 2 server may require extra parameters to narrow down the identity of the user.
75
+ *
76
+ * @param name name of the parameter
77
+ * @param value value of the parameter
78
+ * @return OAuth settings
79
+ */
71
80
OAuthSettings <T > parameter (String name , String value );
72
81
82
+ /**
83
+ * Whether to share the same token between connections.
84
+ *
85
+ * <p>Default is <true>true</true> (the token is shared between connections).
86
+ *
87
+ * @param shared flag to share the token between connections
88
+ * @return OAuth settings
89
+ */
73
90
OAuthSettings <T > shared (boolean shared );
74
91
92
+ /**
93
+ * TLS configuration for requesting the token.
94
+ *
95
+ * @return TLS configuration
96
+ */
75
97
TlsSettings <? extends T > tls ();
76
98
99
+ /**
100
+ * Connection settings.
101
+ *
102
+ * @return connections settings
103
+ */
77
104
T connection ();
78
105
106
+ /**
107
+ * TLS settings to request the OAuth 2 token.
108
+ *
109
+ * @param <T> the type of object returned by methods, usually the object itself
110
+ */
79
111
interface TlsSettings <T > {
80
112
113
+ /**
114
+ * {@link SSLContext} for HTTPS requests.
115
+ *
116
+ * @param sslContext the SSL context
117
+ * @return TLS settings
118
+ */
81
119
TlsSettings <T > sslContext (SSLContext sslContext );
82
120
121
+ /**
122
+ * Go back to the general OAuth 2 settings.
123
+ *
124
+ * @return OAuth settings
125
+ */
83
126
OAuthSettings <T > oauth ();
84
127
}
85
128
}
0 commit comments