Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Cognito InvalidParameterException clientName must contain a scheme

The document shows that we can use custom name. However, it will throw the error "clientName must contain a scheme".

String userPoolId = "ap-northeast-1_XXXXXXXX"; //cens user
    String clientName = "clientName";

    AWSCognitoIdentityProvider provider = AWSCognitoIdentityProviderClientBuilder.defaultClient();

    CreateUserPoolClientRequest update = new CreateUserPoolClientRequest()
            .withUserPoolId(userPoolId)
            .withClientName(clientName)
            .withAllowedOAuthFlows(OAuthFlowType.Implicit)
            .withAllowedOAuthScopes("phone", "email", "openid");

    provider.createUserPoolClient(update);
like image 386
Cenxui Avatar asked Mar 13 '18 08:03

Cenxui


1 Answers

I ran into the same "must contain a scheme" error today when attempting to provision a new Cognito UserPool + UserPoolClient via CloudFormation. It's a poorly worded error. What it should say is: "The URLs you provided for either the callback or logout URLs must contain a scheme, such as https."

Once I updated my URLs so that they started with https, the CloudFormation deploy was able to move beyond the error.

like image 161
capelio Avatar answered Oct 31 '22 20:10

capelio