web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / create a contact recor...
Power Pages
Suggested Answer

create a contact record with a username and password using the Web API

(1) ShareShare
ReportReport
Posted on by 310 Moderator
 


Hi,
Is it possible to create a contact record with a username and password using the Web API?
I've used the following code to create a record in Dataverse, and it works well. However, when I try to log in to Power Pages using the username and password, it denies access, saying "invalid sign-in attempt."
Can anyone help resolve this issue?
 

var record = {};

    record.adx_identity_newpassword = "Test2000"; // Text

    record.adx_identity_username = "username"; // Text

    record.emailaddress1 = "username@gmail.com"; // Text

    record.firstname = "username"; // Text

    record.lastname = "username"; // Text

 

    webapi.safeAjax({

        type: "POST",

        contentType: "application/json",

        url: "/_api/contacts",

        data: JSON.stringify(record),

        success: function (data, textStatus, xhr) {

            var newId = xhr.getResponseHeader("entityid");

            console.log(newId);

        },

        error: function (xhr, textStatus, errorThrown) {

            console.log(xhr);

        }

    });

Categories:
  • Robu1 Profile Picture
    1,747 Super User 2026 Season 2 on at

    Hi  ,

     

    Thank you for choosing Microsoft

    Community.

     

    It sounds like you're on the right track with creating the contact record, but the issue might be related to how Power Pages handles authentication. Here are a few steps to troubleshoot and resolve the "invalid sign-in attempt" issue:

     

    1. Check Authentication Settings: Ensure that your Power Pages site is configured to use local authentication

     

    2. Clear Browser Cache:

    Sometimes, cached data can cause sign-in issues.


    3. Try clearing your browser's cache and cookies, then attempt to log in again 

     

    4. Enable Third-Party Cookies: 

    Make sure third-party cookies and local data are enabled in your browser settings

     

    5. Use Supported Browsers: Ensure you're using a supported browser You can find the list of supported browsers in the system requirements for Power Pages 

     

    6. Check Password Requirements: Verify that the password you're using meets the security requirements set by Power Pages [any other criteria.

     

    7. Reset Password: If you're still having trouble, try resetting the password for the contact recordThis can sometimes resolve issues related to password mismatches.

     

    8. Review Error Logs: Check the error logs in Power Pages for any additional information that might help diagnose the issue.

     

    If these steps don't resolve the issue, it might be helpful to consult the Power Pages documentation or reach out to Microsoft support for further assistance.

     

    Does this help you get closer to resolving the issue?

     

    Alternatively. If this resolves the issue. Kindly mark as resolved.

     

    Happy to help,

     

    Robu1

  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
    try below steps:
     
    • Create the contact with fields like adx_identity_username, emailaddress1
    • Store the hashed password in adx_identity_passwordhash and a unique salt in adx_identity_passwordsalt
    • Portal Management in Power Pages -Local Authentication is enabled by checking that settings for Authentication/Registration and Authentication/Login are set to Local.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 18

#2
11manish Profile Picture

11manish 14 Super User 2026 Season 2

#3
SP2019admin Profile Picture

SP2019admin 4

Last 30 days Overall leaderboard