none
Is it possible to upload a x509 certificate programatically to Microsoft Registration Portal Manifest Using client_secret grant type? RRS feed

  • Question

  • I have been stuck on this issue for some time now, I'm trying to upload a certificate that I have created programmatically on a asp.net web application.

    I know it's possible if the app was created on Azure ADD portal using https://graph.windows.net as resource and use

    var activeDirectoryClient = new ActiveDirectoryClient(serviceRoot, async () => await Task.FromResult(accesstoken));
    
    var keyCredential = new KeyCredential
                    {
                        CustomKeyIdentifier = MyRootCAcert.GetCertHash(),
                        EndDate = expirationDate,
                        KeyId = Guid.NewGuid(),
                        StartDate = startDate,
                        Type = "AsymmetricX509Cert",
                        Usage = "Verify",
                        Value = binCert
                    };
    
    var application = await activeDirectoryClient.Applications
                      .GetByObjectId("***applicationID***").ExecuteAsync();
    
                    application.KeyCredentials.Add(keyCredential);
    application.UpdateAsync().Wait();

    However I have created a web app in Microsoft registration portal to access users calendars with read and write permissions and the code above doesn't work since my resource is https://graph.microsoft.com/ . I have been checking forums, documentation, blogs and everyone points to creating the app on Azure and using https://graph.windows.net as resource..

    Do I have to remake my app or is there a way to upload the certificate and I haven't researched good enough?

    All Help is appreciated!

    Tuesday, July 10, 2018 12:16 PM

Answers

  • I'd ask for help over here in microsoft official asp.net forums.

    https://forums.asp.net/

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 10, 2018 12:38 PM
    Moderator

All replies

  • I'd ask for help over here in microsoft official asp.net forums.

    https://forums.asp.net/

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 10, 2018 12:38 PM
    Moderator
  • where did you move it to :)?
    Tuesday, July 10, 2018 2:07 PM
  • This is "where is" forum for direction on where best to ask questions.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 10, 2018 2:08 PM
    Moderator
  • My bad, didn't really know. I posted it on the link that you suggested but was confused about

    "Moved by Dave Patrick<abbr class="affil">MVP, Moderator</abbr> 1 hour 32 minutes ago not reporting forums application issues "


    Tuesday, July 10, 2018 2:11 PM
  • You originally posted in 

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=reportabug

    This forum is used to report issues with the online forums application. So I moved it.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 10, 2018 2:14 PM
    Moderator
  • Aha ok, now I understand :) should have checked the description before I posted, my bad
    Tuesday, July 10, 2018 2:23 PM
  • Not a problem. :)

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, July 10, 2018 2:24 PM
    Moderator