Merge branch 'master' into develop
# Conflicts: # backend/pom.xml # backend/src/main/java/ru/micord/ervu/security/esia/service/EsiaAuthService.java # distribution/pom.xml # frontend/pom.xml # pom.xml # resources/pom.xml
This commit is contained in:
commit
87debfc1b5
1 changed files with 19 additions and 0 deletions
|
|
@ -124,4 +124,23 @@ public class EsiaPersonalDataService implements PersonalDataService {
|
|||
throw new EsiaException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsiaHeader readHeader(String accessToken) {
|
||||
try {
|
||||
byte[] decodedBytes = Base64.getDecoder()
|
||||
.decode(
|
||||
accessToken.substring(0, accessToken.indexOf('.'))
|
||||
.replace('-', '+')
|
||||
.replace('_', '/'));
|
||||
String decodedString = new String(decodedBytes);
|
||||
EsiaHeader esiaHeader = objectMapper.readValue(decodedString,
|
||||
EsiaHeader.class
|
||||
);
|
||||
return esiaHeader;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new EsiaException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue