Hello Pangea Community,
I’m currently integrating the Pangea AuthN service into my application. I have correctly configured the AuthN service in the developer console and set “http://localhost:3000/” as the default redirect URL under the AuthN service settings. Despite this, I’m encountering a “Bad Session Error” related to an “Invalid redirect_uri”.
Any guidance on how to resolve this issue would be greatly appreciated.
1 Like
Could you please share more information?
- Have you configured http://localhost:3000 as
default hosted redirect
?
- Could you also provide your login URL (including request params)?
- Also, you can retrieve the request ID from the web browser console log. With that information, I can look into the error on our end.
Thank you for your response! I have configured “http://localhost:3000” as my default hosted redirect. Attached is a screenshot of what that looks like
The login URL is “http://localhost:3000”
I followed the steps outlined in the pangea nextjs-authn repo
I am developing the app using GitHub codespaces
My workflow is, I run “npm run dev” and the browser opens a webpage on “localhost:3000”. I see the following unauthenticated user page:
I get the bad request error when I click the the “Sign In”
Is the request ID under the network tab?
Hi @iggy_eth, I tried the same using the GitHub Codespace. The Invalid redirect_uri callback
error occurred because the default port of the Github Codespace will be like this: https://CODESPACENAME-PORT.app.github.dev
. Which then redirects you to localhost:3000
.
To resolve this, you can add the codespace url in the Redirect (Callback) Settings and try it again.
Note: It works fine, if you run it locally!
Omggg it works now! I added in the codespace url…i dont know why my mind didnt try that first.
Thanks!
2 Likes
Hi @echoaadarsh & @Hemendra_Choudhary I’m having another issue with setting up the URL as the ‘Default Hosted Redirect.’ After adding the URL and selecting ‘Default,’ I click Save but get an error message saying I must choose at least one ‘Default Hosted Redirect.’
So, I select the ‘/login-success’ as the default, save, and wait a few minutes. Then, I try setting the new URL as the ‘Default Hosted Redirect’ again, and it works. I’m not sure if this is how it’s supposed to work, but I thought I’d mention it.
Another one, one the “Branding” page, how do I add a logo for my app
Hi @iggy_eth, the error message: At least one redirect must be set as the 'Default Hosted Redirect'
appears whenever you attempt to click ‘Save’ before configuring any URL as the ‘Default Hosted Redirect’. If you added it but still got the error, then i guess something went wrong.
To add the logo, you need to enter the URL of the image in the Branding Page’s Logo Section.
Check out Branding | Pangea docs for more details on the customization and branding options for hosted pages.
1 Like
I got the redirect error after making the new url which was the codespace url the “Default Hosted Redirect”. It happened a couple of times now. I set it, click save and get the error. The error only disappears when I make “login-success” the default, add the new url and save. Wait some minutes, then try setting the new as the default. I can record a video to show what I mean
As for the image URL, I should’ve been clearer. I add the image URL but I cant see the logo. Here’s what I see instead:
I guess that the response from the image URL you entered was blocked by CORB (Cross-Origin Read Blocking). If your logo asset is uploaded on GitHub, try providing the raw URL of the image instead of the file path URL.
1 Like
I tried this but it’s not working…I’ve been trying to figure out why but I’ve been unable to. I uploaded the image the GitHub and provided the raw URL. Quick question, what do you mean by raw URL?
For example, is the following a raw URL or the file path: https://github.com/testuser/app/blob/main/public/logo.png
This one is a File path URL.
If you right click on the image and copy the image URL, you will get the url like this: https://github.com/testuser/app/blob/main/public/logo.png?raw=true
or if you open the image in new tab, you will see the URL like this: https://raw.githubusercontent.com/testuser/app/main/logo.png
Try entering one of these url’s or you can host the image somewhere and use it.
2 Likes
Thank you so much!! It works now
1 Like