Account confirmation after registration is not working

Reno Welleman 0 Reputation points
2024-11-18T10:25:12.33+00:00

When registering a new account in unit 3 and 5 of the training the account confirmation part doesn't work on my system. I'm using github codespaces and have added the port in the link. After registration it now gives me the confirmation link of the email in the console which looks like this:
SUBJECT: Confirm your email

CONTENTS: Please confirm your account by <a href='https://localhost:7192/Identity/Account/ConfirmEmail?userId=52a9a51b-3085-4f75-a8cc-9ccee5396e83&code=Q2ZESjhBZnJVdDk3MkRwS29aQnRNdEdRYTEzbk1vdmgvSG9FWklFNkhTU0lScXd0bjkyQ2w4eExUZVFiSlFUcWRQckx6V1AzejZkZkZlYmphWUE3U3NYQkFQMXcxNlZVcGlRSzZsNmNrY0Rrc3ZocXg3V2hwclMydGJrK2Q5UWVGY3JDcS9Kbmc5WG1WM2J2eGlVSHVqcWVLNWo2STE3WElxeGdIdTNRN1g4NzU2ZkMvTldzTEo0S0dTekM4U0txaFJJNjcxSDZ1NjNxVFJGeUdjSHhBeExtK3FaZ2htZ01Ob29RM01ISjcyTWxpalhxM09BQjZlZktFU3hnMVNIZG5wenBOUT09'>clicking here</a>.

This question is related to the following Learning Module

ASP.NET Core Training
ASP.NET Core Training
ASP.NET Core: A set of technologies in the .NET Framework for building web applications and XML web services.Training: Instruction to develop new skills.
28 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep M 4,320 Reputation points Microsoft Vendor
    2024-11-19T03:21:55.2833333+00:00

    Hi Reno Welleman,

    Thank you for reaching out to Microsoft Q & A forum.  

    It seems the issue stems from using the localhost URL in the email confirmation link when working within GitHub Codespaces. The URL generated in the console (https://localhost:7192) is tied to your local environment and cannot be directly accessed externally or from the browser. 

    To resolve this, you'll need to modify the generated link to use the appropriate forwarded URL for your Codespaces environment. Here’s what you can do: 

    1.Identify Your Codespaces URL 

    In GitHub Codespaces, the application is usually forwarded through a URL in the format: 

    https://<codespace-name>-7192.preview.app.github.dev. 

    Replace <codespace-name> with the specific identifier for your Codespace. 

    2.Update the Confirmation URL 

    When you see the confirmation email content in the console, copy the generated URL. 

    Replace https://localhost:7192 with your Codespace's forwarded URL (e.g., https://scaling-potato-5gr4j4-7192.preview.app.github.dev). 

    3.Test the Confirmation Link 

    Open the modified URL in your browser to complete the confirmation process. 

    Alternatively, if you'd like to avoid manual editing, you can configure the ApplicationUrl in your ASP.NET Core app's launchSettings.json to use the forwarded Codespaces URL. This will generate the correct links automatically. 

    Please feel free to contact us if you have any additional questions.    

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.         

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.