Why do I get error "provide a properly configured and signed bearer token" when creating cert after upgrade to VS 17.12

Kurt K 176 Reputation points
2024-12-04T18:56:41.9666667+00:00

I recently upgraded to Visual Studio 2022 17.12. At about the same time, my ios development cert expired.

So I needed to create a new development certificate.

First I tried to create a one using the "Create Certificate" dropdown by:

  • Choosing the Tools -> Options menu item
  • Navigating to Xamarin -> Apple Accounts
  • Chose my existing Apple account
  • Clicked "View Details..."

I got the "... provide a properly configured and signed bearer token ..." error.

Then I tried to create a new cert consulting the video by Gerald Versluis: https://www.youtube.com/watch?v=kpZi5xAvpZA

It seemed to work since a new cert shows up as active on my Mac and in my Apple developer account.

I then edited my existing dev provisioning profile to replace the old cert with the new one.

However, I could not get the new cert and provisioning profile to show up in Visual Studio.

Finally, I decided to create a new .net maui project to see if I could then see the new cert and provisioning profile in visual studio - I could not.

Also, still in this new project the "Create Certificate" dropdown still generates the same error.

Can you give me hints on how to proceed?

Thank you

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,835 questions
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 34,556 Reputation points Microsoft Vendor
    2024-12-18T06:15:29.1466667+00:00

    Hello,

    Since there are some valid certificates in "Keychain Access" on Mac and you can open the ...\AppData\Local\Xamarin\iOS\Provisioning(certificates) folders, there is an easy way to import certificate and provisioning profile into VS, please follow the steps blow:

    1. Open "Keychain Access“, find a valid development certificate, right-click it and choose "Export...", and then you can enter a password, and you will get a p12 file.
    2. Move/Copy this p12 file to your Windows machine.
    3. Open VS 2022 and go to Tools-> Options-> Xamarin-> Apple Accounts->select the account you login -> View Details->Import Certificate, select the p12 file on step2 and enter the password on step1.

    After that, the certificate will exist on the \AppData\Local\Xamarin\iOS\Certificates folders.

    If you have the matching provisioning profile (*.mobileprovision files), you could move it to \AppData\Local\Xamarin\iOS\provisioning folder.

    And then, you could select the Signing identity (certificate) and provisioning profile for your project.

    (Open your project->right-click and open Properties window->iOS->Bundle Signing)

    Important

    According to the description, you have revoked the current development cert from Apple account and delete the associated development profile from Apple account. It's not clear that if the valid certificate on "Keychain Access" is matched with the previous development provisioning profile (Or if the development provisioning profile was expired or you deleted/revoked it by mistake) .

    It's better to create a new development provisioning profile with the valid development certificate on Keychain Access. Please follow the steps below:

    1. Open Apple developer portal, under Certificates tab, confirm the valid development certificate is same as that on Keychain Access.
    2. Go to Profiles tab, choose iOS App Development -> choose the AppID (your MAUI project AppID or the wildcard AppID) ->select all certificates -> all devices->enter name->Generate->Download, and then you will get a development provisioning profile (*.mobileprovision files).
    3. Move it to \AppData\Local\Xamarin\iOS\provisioning folder.

    For more details, you could refer to Manual provisioning for .NET MAUI iOS apps - .NET MAUI | Microsoft Learn

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.