Hello @TEJENDRA PRASAD PATEL and thanks for reaching out. You will find my answers below your questions:
- Is this possible to persist custom claim created by mainlanding and can be access by subapp ?
As stated by @Bruce (SqlWork.com) , Azure ID token is usually serialized in the web app cookie and can be shared provided both web apps share the same Azure AD app registration, otherwise claim validation may fail. For more information take a look at Share authentication cookies among ASP.NET apps. - Do i need create custom claims in both application separately?
You can create a common lib that that handles such task and can be used by both web apps. - Or, i need to register application separately?
Since claims processing is done in the web apps, your best bet is to add the claims in each web app. Alterntivately you may add custom claims before token issuance. For more information take a look at Provide optional claims to your app and Customize claims emitted in tokens for a specific app in a tenant. In the latter scenario, many apps can share a single policy.
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.