{"id":2945,"date":"2018-05-23T19:55:29","date_gmt":"2018-05-23T19:55:29","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/aaddevsup\/?p=2945"},"modified":"2021-02-18T23:05:26","modified_gmt":"2021-02-18T23:05:26","slug":"how-to-change-a-display-name-of-a-registered-application-from-another-application","status":"publish","type":"post","link":"https:\/\/blogs.aaddevsup.xyz\/2018\/05\/how-to-change-a-display-name-of-a-registered-application-from-another-application\/","title":{"rendered":"How to change a display Name of a registered application from another application"},"content":{"rendered":"

Introduction:<\/h3>\n

This post will show you to change a displayName of a registered web application from another application using client credentials flow with Application Permission<\/p>\n

Walk Through steps:<\/h3>\n

1) In Azure AD\u2019s App Registration portal, create 2 new app registrations called TestAppA and TestAppB. We will use TestAppA to change the display Name of TestAppB. It is not important what permission you configure for TestAppB. For TestAppA make sure you configure Microsoft Graph\u2019s Application.ReadWrite.OwnedBy permission (check the option for \u201cManage apps that this app creates or owns) under Application Permission and also click on the \u201cGrant Permission\u201d button to provide admin consent to TestAppA<\/p>\n

\"clip_image002\"<\/a><\/p>\n

Also note the Application ID for both TestAppA and TestAppB<\/p>\n

\"clip_image004\"<\/a><\/p>\n

2) For TestAppA create a new key and note its value:<\/p>\n

\"clip_image006\"<\/a><\/p>\n

3) Get the Object ID of TestAppA\u2019s Service Principal from the Enterprise applications blade<\/p>\n

\"clip_image008\"<\/a><\/p>\n

4) Use Microsoft Graph Explorer<\/a> tool to make the TestAppA\u2019s Object ID obtained in step 3 the owner of TestAppB by issuing the following POST request:<\/p>\n

POST https:\/\/graph.microsoft.com\/applications\/{id of App2}<\/span>\/owners\/$ref
\nPOST Body:
\n{<\/p>\n

“@odata.id”:”https:\/\/graph.microsoft.com\/v1.0\/servicePrincipals\/{SP ObjectId of App1}<\/span>“<\/p>\n

}<\/p>\n

\"clip_image010\"<\/a><\/p>\n

Note<\/strong><\/span>: Wait at least 20 minutes to perform the steps below:<\/p>\n

5) For demo purposes I am using PostMan in this step to get an access token for TestAppA.<\/p>\n

POST request to https:\/\/login.microsoftonline.com\/<Directory ID>\/oauth2\/v2.0\/token<\/u><\/p>\n

POST body:<\/p>\n

grant_type=client_credentials&scope=https:\/\/graph.microsoft.com\/.default&client_id=<TestAppA App ID>&client_secret=xxx<\/p>\n

\"clip_image012\"<\/a><\/p>\n

6) Use PostMan to issue a PATCH request with an access token obtained above to change TestAppB\u2019s displayName<\/p>\n

PATCH https:\/\/graph.microsoft.com\/beta\/applications\/<TestAppB App ID>
\nBody:
\n{<\/p>\n

“displayName”: “new name”<\/p>\n

}
\n
\"clip_image014\"<\/a><\/p>\n

Summary:<\/h3>\n

The steps above demonstrates the concept of how to change an application\u2019s property such as displayName from another application. You can use the same technique to change an application\u2019s other properties. The key here is that in order to change an application\u2019s property, the calling app needs to have Application.ReadWrite.OwnedBy MS Graph permission and it needs to be an owner of the callee app. For demo purposes, this post uses PostMan to get an access token and issues an MS Graph call to change the property. In practice the calling application can use ADAL library to get an access token and make the same MS Graph call.<\/p>\n","protected":false},"excerpt":{"rendered":"

Introduction: This post will show you to change a displayName of a registered web application from another application using client credentials flow with Application Permission Walk Through steps: 1) In Azure AD\u2019s App Registration portal, create 2 new app registrations called TestAppA and TestAppB. We will use TestAppA to change the display Name of TestAppB. It is not important what permission you configure for TestAppB. For TestAppA make sure you…<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-2945","post","type-post","status-publish","format-standard","hentry","category-authentication","category-microsoftgraph"],"_links":{"self":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/2945"}],"collection":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/comments?post=2945"}],"version-history":[{"count":1,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/2945\/revisions"}],"predecessor-version":[{"id":7973,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/2945\/revisions\/7973"}],"wp:attachment":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/media?parent=2945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/categories?post=2945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/tags?post=2945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}