-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAccessToken.java
More file actions
29 lines (24 loc) · 1.13 KB
/
AccessToken.java
File metadata and controls
29 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package oiccli.service;
import java.util.Arrays;
import java.util.Map;
import oiccli.AuthorizationResponse;
import oiccli.client_info.ClientInfo;
import oiccli.exceptions.ParameterError;
import oiccli.exceptions.UnknownState;
public class AccessToken extends service.AccessToken {
private AccessTokenRequest accessTokenRequest;
private AccessTokenResponse accessTokenResponse;
private TokenErrorResponse tokenErrorResponse;
private List<> postParseResponse;
public AccessToken(String httpLib, KeyJar keyJar, String clientAuthenticationMethod) {
super(httpLib, keyJar, clientAuthenticationMethod);
this.postParseResponse = Arrays.asList(this.oicPostParseResponse);
}
public void oicPostParseResponse(AuthorizationResponse response, ClientInfo cliInfo, String state) throws ParameterError, UnknownState {
cliInfo.getStateDb().addResponse(response, state);
Map<String, String> idt = response.get("verifiedIdToken");
if (!cliInfo.getStateDb().nonceToState(idt.get("nonce")).equals(state)) {
throw new ParameterError("Someone has messed with the 'nonce'");
}
}
}