File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
src/main/java/com/kq/pulsar/client/auth Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 2
2
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
3
3
<modelVersion >4.0.0</modelVersion >
4
4
<groupId >com.kq.pulsar.client</groupId >
5
- <artifactId >SimpleClient </artifactId >
5
+ <artifactId >pulsar-client-plugin </artifactId >
6
6
<packaging >jar</packaging >
7
7
<version >1.0-SNAPSHOT</version >
8
8
<name >SimpleClient</name >
Original file line number Diff line number Diff line change @@ -40,12 +40,11 @@ public void close() throws IOException {
40
40
41
41
@ Override
42
42
public String getAuthMethodName () {
43
- return "token " ;
43
+ return "auth0 " ;
44
44
}
45
45
46
46
@ Override
47
47
public AuthenticationDataProvider getAuthData () throws PulsarClientException {
48
- // return new AuthenticationDataToken(tokenSupplier);
49
48
return new AuthenticationDataAuth0 (tokenSupplier );
50
49
}
51
50
Original file line number Diff line number Diff line change @@ -62,9 +62,14 @@ public JSONObject generate() throws UnsupportedEncodingException {
62
62
.body (bodyMap )
63
63
.asJson ();
64
64
65
- System .out .println (response .getStatus ());
66
- JSONObject jsonObj = response .getBody ().getObject ();
65
+ Unirest .config ().reset ();
66
+ int statusCode = response .getStatus ();
67
+ //TODO: add retry-after 503, 429, 301
68
+ if (statusCode != 200 ) {
69
+ throw new JWTVerificationException ("invalide auth0.com status code " + statusCode );
70
+ }
67
71
72
+ JSONObject jsonObj = response .getBody ().getObject ();
68
73
return jsonObj ;
69
74
}
70
75
You can’t perform that action at this time.
0 commit comments