Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

App License key - suggest a logic

(0) ShareShare
ReportReport
Posted on by 213

I have created an app, which expires in 3 months
I have added a functionality where I give a key to user and app can be extended further- by 6months or 1 yr
it is working fine but if app is used by a company on multiple tenants then same key can be used
how can I avoid this?
I can ask tenant id and generate a key based on that?
SaaS based does not allow encryption based on personal key?
I do not want to use stripe or api to check the key, it must be something within app.
I am using IsolatedStorage for key.

Please suggest a logic,

  • Ajay Jain Profile Picture
    213 on at
    RE: App License key - suggest a logic

    Thank you ZHU,

    This is what I want to know, how do you generate key for a SaaS environment based on company and date,
    and that key will not work in other environment.

    do you have any code example?

    Thanks

    Ajay

  • Suggested answer
    YUN ZHU Profile Picture
    86,030 Super User 2025 Season 1 on at
    RE: App License key - suggest a logic

    Hi, The following is just my previous practice, although it may not be a perfect solution, I hope to give you some hints.
    1. We generate the Activation Key based on the company name and Iussed date (For example: Valid for 3 days of issue.).

    2. Enter the company name and Activation Key when activating. But only the Production environment will verify the Iussed date, and customers can always install it in their Sandbox environments. But if they want to install it to another Production environment, they need to apply for a Key again.

    Hope this helps.
    Thanks.

    ZHU

  • Ajay Jain Profile Picture
    213 on at
    RE: App License key - suggest a logic

    secret key which will be stored via IsolatedStorage

    Secret key should work for specific Tenant ID, so same key should not be applied to another Tenant ID

    If I do encrypt my key with Tenant id that can be decrypted

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: App License key - suggest a logic

    Hello,

    Are you talking about a secret key / certificate within the Azure AD app registration?

    Thank you.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans