Skip to content

Commit 5211d83

Browse files
committed
Minor update to error handling when cert cant bve loaded
1 parent e58cf42 commit 5211d83

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

services/signin/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,10 @@
5656
<artifactId>http-auth-aws</artifactId>
5757
<version>${awsjavasdk.version}</version>
5858
</dependency>
59+
<dependency>
60+
<groupId>software.amazon.awssdk</groupId>
61+
<artifactId>profiles</artifactId>
62+
<version>${awsjavasdk.version}</version>
63+
</dependency>
5964
</dependencies>
6065
</project>

services/signin/src/main/java/software/amazon/awssdk/services/signin/internal/DpopAuthPlugin.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import software.amazon.awssdk.annotations.SdkInternalApi;
2222
import software.amazon.awssdk.core.SdkPlugin;
2323
import software.amazon.awssdk.core.SdkServiceClientConfiguration;
24+
import software.amazon.awssdk.core.exception.SdkClientException;
2425
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
2526
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeProvider;
2627
import software.amazon.awssdk.identity.spi.IdentityProvider;
@@ -63,7 +64,11 @@ public void configureClient(SdkServiceClientConfiguration.Builder config) {
6364
// the refresh request takes the clientId/refreshToken sourced from the access token on disk as input
6465
// so we must sign the request with the dpopKey loaded from the same load. IE: do not read the
6566
// access token file twice!
66-
scb.putAuthScheme(DpopAuthScheme.create(StaticDpopIdentityProvider.create(dpopKeyPem)));
67+
try {
68+
scb.putAuthScheme(DpopAuthScheme.create(StaticDpopIdentityProvider.create(dpopKeyPem)));
69+
} catch (Exception e) {
70+
throw SdkClientException.create("Unable to refresh Login credentials. Please reauthenticate ", e);
71+
}
6772
}
6873

6974
private static class DpopAuthSchemeProvider implements SigninAuthSchemeProvider {

services/signin/src/main/java/software/amazon/awssdk/services/signin/internal/EcKeyLoader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ private static class ParsedEcKey {
121121
byte[] publicBytes;
122122
}
123123

124-
125124
/**
126125
* Follows the SEC1 / RFC 5915 ASN.1 format: PrivateKeyInfo ::= SEQUENCE { version INTEGER (0), privateKeyAlgorithm
127126
* AlgorithmIdentifier, -- ecPublicKey + curve OID privateKey OCTET STRING -- contains the SEC1 DER parameters [0]

0 commit comments

Comments
 (0)