Token is not from a supported provider of this identity pool.
Shinehah-Gnolaum opened this issue · 0 comments
I am getting an error that says, "Token is not from a supported provider of this identity pool."
I am using Eclipse. I am able to sign up ok, but when I sign in, I get this in the console when I run the app in MainForm. I get the same result when I run the app in MainConsole.
{"sub":"52c99df9-f7ef-42b2-9127-9675ba4e2414","email_verified":false,"iss":"https://cognito-idp.us-east-1.amazonaws.com/us-east-1_d0Y5gS66r","phone_number_verified":true,"cognito:username":"yahoo03","aud":"4feegfdtp0dbt9atu56vruuv37","event_id":"c77eff2c-01ad-42c3-8dac-a4849dc297c6","token_use":"id","auth_time":1560793958,"phone_number":"+19032761046","exp":1560797558,"iat":1560793958,"email":"ole.gnolaum@gmail.com"}
User is authenticated:eyJraWQiOiJ4K1piekppSWN4RjZtbDVENjVSQXAySlBOQ0ROK2FmU3Fpc1BnSDE0c3ZvPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI1MmM5OWRmOS1mN2VmLTQyYjItOTEyNy05Njc1YmE0ZTI0MTQiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0xX2QwWTVnUzY2ciIsInBob25lX251bWJlcl92ZXJpZmllZCI6dHJ1ZSwiY29nbml0bzp1c2VybmFtZSI6InlhaG9vMDMiLCJhdWQiOiI0ZmVlZ2ZkdHAwZGJ0OWF0dTU2dnJ1dXYzNyIsImV2ZW50X2lkIjoiYzc3ZWZmMmMtMDFhZC00MmMzLThkYWMtYTQ4NDlkYzI5N2M2IiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE1NjA3OTM5NTgsInBob25lX251bWJlciI6IisxOTAzMjc2MTA0NiIsImV4cCI6MTU2MDc5NzU1OCwiaWF0IjoxNTYwNzkzOTU4LCJlbWFpbCI6Im9sZS5nbm9sYXVtQGdtYWlsLmNvbSJ9.BqyjJJgOZcQP7yUDd3wDrrK4pNRs8BE8RvBzl2vIz248f3rgQ4fn1cd54azjtlplGkthbB0zA9xcd7gPJzqffd-3wS9RFevxkT4LfSiGF1UXGpIqHH_GhbMHA4dG6nKqBOmInvcn9gR1oblBszdbvUxE1poyP3MLvIi64vRvYm1P2kdikWlXl7qKH_RFivEmRMbpd4xpXH6Gjv3hxE6w2vn4O3oZkwz5eY-djUfbwy_uhItycPB3yZLGS8LU55vkrvyJrzHQLDu1U5AvkHGLZv1H7GveHm36RRwSGH5ZkCrtfkolRBN7wkqq9pGhh3jccqHN6Ml5L3XmH3irFNikfw
provider = cognito-idp.us-east-1.amazonaws.com/us-east-1_d0Y5gS66r
Exception in thread "JavaFX Application Thread" com.amazonaws.services.cognitoidentity.model.NotAuthorizedException: Token is not from a supported provider of this identity pool. (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: NotAuthorizedException; Request ID: b295ece8-9128-11e9-bb89-5d1e066e532b)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1639)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1056)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.doInvoke(AmazonCognitoIdentityClient.java:1602)
at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.invoke(AmazonCognitoIdentityClient.java:1578)
at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.executeGetId(AmazonCognitoIdentityClient.java:793)
at com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.getId(AmazonCognitoIdentityClient.java:769)
at com.amazonaws.sample.cognitoui.CognitoHelper.GetCredentials(CognitoHelper.java:190)
at com.amazonaws.sample.cognitoui.MainForm.lambda$1(MainForm.java:90)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Node.fireEvent(Node.java:8411)
at javafx.scene.control.Button.fire(Button.java:185)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$358(GlassViewEventHandler.java:432)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
The line that says
provider = cognito-idp.us-east-1.amazonaws.com/us-east-1_d0Y5gS66r
Is from a println statement I put in the start method in the MainForm class. Here is the segment of code with the println statement and the line right before it:
String provider = payload.get("iss").toString().replace("https://", ""
System.out.println("provider = " + provider);