Git Product home page Git Product logo

Comments (7)

limulidae avatar limulidae commented on May 21, 2024 3

you need to add capability.

using Microsoft.ManagementExperience.Extensibility.Capabilities;
[assembly: UserCredentialsCapability()]

from windows-admin-center-sdk.

akviacode avatar akviacode commented on May 21, 2024

[assembly: UserCredentialsCapability()]
Added this line to the example project. And now it's working. Thanks.

from windows-admin-center-sdk.

akviacode avatar akviacode commented on May 21, 2024

Now this code line works:
var credentials = this.GetWindowsCredential(url.TargetNode)
We've got, it works only once. A second time access does not throw an error, but it does not return data either. So password, username are empty strings.
E.g.

  1. Connect to Windows Server host.
  2. Navigate to our tool.
  3. Our gateway plugin is requested, data is loaded.
  4. Can read Windows Server credentials.
  5. Next work with data in our tool. And request our gateway plugin again.
  6. Cannot read Windows Server credentials, all fields are empty. Moreover, all cached data of our gateway plugin is cleaned.

from windows-admin-center-sdk.

mattatmsft avatar mattatmsft commented on May 21, 2024

Hi - Could you tell me which version of Windows Admin Center you are running (question mark in the top right hand corner)?

In the latest builds, you can consider the plugin to be transient, exactly in the same manner as a WebAPI controller. Every request will get a new instance of the plugin, so you'll have to do cache management carefully. Be aware that the app domain can be recycled any time so in memory caching can be tricky, and you need to make sure you can recover.

I would recommend that you look at what can be pushed to the UI throught he user or application settings: http:///devguide/tools/settings-manager/userProfile

Also, if you have any sensitive data, it needs to be protected: http:///devguide/tools/secure-extension-dation

from windows-admin-center-sdk.

akviacode avatar akviacode commented on May 21, 2024

Thanks, for the reply. Now it's clear, how plugin memory cache works.
But still need to know, why this code
var credentials = this.GetWindowsCredential(url.TargetNode)
returns password, username as empty strings.

WAC we are running:
Version: 1906
Build: 1.2.1906.03003

P.S. Link to devguide/tools/secure-extension-dation is dead. Is there newaer verision of devguide? We are using 1.366.0

from windows-admin-center-sdk.

mattatmsft avatar mattatmsft commented on May 21, 2024

Ah i see the problem, my urls got messed up. What I mean is to hit the built in Dev Guide inside of Windows Admin Center. In the menu on the left there is a section for settings manager:
image

Does that make more sense?

from windows-admin-center-sdk.

akviacode avatar akviacode commented on May 21, 2024

Yes. Got it, thank you.
So we'll move our cached in memory data for gateway plugin to this settings.

But what about the credentials. In C# code of gateway plugin previously you suggest to use this this.GetWindowsCredential(url.TargetNode)
And now it returns empty strings.
Should we obtain credentials of Win Server Hosts in other way now? Can we get it via some kind of admin setting manager and then pass it in our tool and gateway plugin (attach in request context)?

from windows-admin-center-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.