Does Services module still need a key - drupal

I'm reading a book that suggests that you try to configure the Services module, you should see 3 tabs: Browse, Settings, and Keys. I'm working with the latest release and all I see is Browse and Settings. Anyone knows what happened to the Keys tab? Has the module logic changed?

If you enable Key Authentication within Services, Keys will present itself.

Related

Do WinUI applications need runFullTrust to publish to the Windows Store?

I recently took a stock WinUI template, added my old UWP C# code, recompiled and tried to publish. The Windows Store Application Submission warns me that I shouldn't use the runFullTrust setting:
We detected the use of one or more restricted capabilities in your Package.appxmanifest file. You must request approval to use restricted capabilities by providing more information below. Please include as much detail as possible. Learn more
If you don't need to declare these capabilities or added them in error, you can remove them from your Package.appxmanifest file and then upload the updated package(s).
but here's what I got from the template:
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
I tried removing it, but it wouldn't even compile. Can anyone tell us the backstory of this flag, why it's needed in WinUI but not UWP, and how we get around the Windows Store Submission error.
Do WinUI applications need runFullTrust to publish to the Windows Store?
Yes.
A WinUI 3 app uses the full-trust desktop app model. A UWP app runs in a sandbox.
As stated in the docs, distributing your packaged desktop (WinUI 3) app requires you to answer "a few extra questions as part of the submission process. That's because your package manifest declares a restricted capability named runFullTrust, and we need to approve your application's use of that capability."
So you should provide information about why you need to use the runFullTrust restricted capability when you publish the app. You could for example explain that it's a desktop app and what it does.
WinUI 3 does not need to be full trust, but you still need to declare any UWP-like capacities you are using.
Here is a tutorial that shows how to do it.
https://nicksnettravels.builttoroam.com/winui-appcontainer/

How to see all references/calls to keys in app.config or web.config in a visual studio solution?

The question: Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?
The situation/details: I have 3 keys in a web.config as part of a botframework solution: MicrosoftAppId, MicrosoftAppPassword, and DataStore.
Searching for "ConfigurationManager.AppSettings", I only get one result: a reference to the DataStore key, which I added myself. I cannot find any references to the other keys. I've also searched the entire solution for the names of both keys, and I get no results. The bot framework docs indicate the purpose of these keys (https://learn.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0) and the bot doesn't work if I comment them out, so I know they are being called somewhere, but I need help finding where.
The reason I am trying to find where these keys are called in the code is: I need to move these keys/values to a different, encrypted file, and will need to know where the code needs to be redirected to the new location.
Thanks in advance!
For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.
Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.
Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.

How to Store user login credential in Xamarin.Form

I want to store the username and password of users locally. i have searched a lot can't find a working solution for Xamarin.forms.I have seen this official site that recommend to use Xamarin.Auth to store in keychain but the tutorial in on platforms specific which i dont know how to convert to Xamarin.Forms.
A little bit help on how to make this to work in Xamarin.Form is very much appreciate.
I have been using the SecureStorage plugin which saves these kinds of settings in the platforms secure storage from the shared code.
There are a couple of things good to know.
iOS
On the Simulator you could run into an issue where values do not get saved. To overcome this open the Entitlements.plist file and make sure that "Enable Keychain Access Groups" is checked. Also ensure that in Project->Options->iOS Bundle Signing, the Entitlements.plist is selected in Custom Entitlements for iPhoneSimulator platform.
Android
You have to set a password when initialising, like this:
SecureStorageImplementation.StoragePassword = "Your Password";
This will be used to encrypt te settings. Make sure you keep it secret and do not change it.
Windows
Same thing as Android, but now call WinSecureStorageBase.StoragePassword = "Your password";
If you have done this, you can now save any setting your like with:
CrossSecureStorage.Current.SetValue(“SessionToken”, “1234567890”);
Which can then be retrieved like this:
var sessionToken = CrossSecureStorage.Current.GetValue (“SessionToken”);
There are some more calls to delete a key and see if a key is present. Don't forget to install the NuGet package on both your shared code as well as your platform projects.
You can check on this link for how to use Xamarin.Auth in Xamarin.Forms.
One more option i would consider is using Akavache which can be used to store the data with same level of security & how to integrate it in Xamarin.Forms check on this link

How to detect if ASP.NET is enabled in IIS 7

The challenge is to determine whether ASP.NET is enabled within IIS7 in a reliable and correct way.
Enabling/Disabling is done in this case by going into:
Server Manager ->
Roles ->
Web Server (IIS) ->
Remove Role Services ->
Remove ASP.NET
The natural place to determine this should be within the applicationHost.config file. However, with ASP.NET enabled or disabled, we still have the "ManagedEngine" module available, and we still have the isapi filter record in the tag.
The best I can find at the moment is to check if the <isapiCgiRestriction> tag includes the aspnet_isapi.dll, or that the ASPNET trace provider is available.
However these aren't detecting the presence of the ASP.NET config directly, just a side effect that could conceivably be reconfigured by the user.
I'd rather do this by examining the IIS configuration/setup rather than the OS itself, if possible, although enumerating the Roles & Services on the server might be acceptable if we can guarantee that this technique will always work whenever IIS7 is used.
Update
Thanks for the responses. Clarifying exactly what I want to do, I'm pulling settings from a variety of places in the server's configuration into a single (readonly) view to show what the user needs to have configured to allow the software to work.
One of the settings I need to bring in is this one:
The one highlighted in red.
I don't need to manipulate the setting, just reproduce it. I want to see whether the user checked the ASP.NET box when they added the IIS role to the server, as in this example they clearly didn't.
I'd like to do this by looking at something reliable in IIS rather than enumerating the role services because I don't want to add any platform specific dependencies on the check that I don't need. I don't know if it will ever be possible to install IIS7 on a server that doesn't have the Roles/Services infrastructure, but in preference, I'd rather not worry about it. I also have a load of libraries for scrubbing around IIS already.
However, I'm also having trouble finding out how to enumerate the Roles/Services at all, so if there's a solution that involves doing that, it would certainly be useful, and much better than checking the side effect of having the ASPNET trace provider lying around.
Unfortunately, if you don't check the ASP.NET button, you can still get the ManagedEngine module in the IIS applicationHost.config file, so it's not a reliable check. You can also have ASP.NET mapped as an isapi filter, so checking them isn't enough. These things are especially problematic in the case where ASP.NET was installed but has been removed.
It looks like the best solution would be to examine the Role Services. However, API information on this is looking pretty rare, hence the cry for help.
The absolute way to know if they checked that or not is to search the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Components
In there you should see two values set to 1, ASPNET and NetFxEnvironment and NetFxExtensibility. This registry key is the IIS Setup key that contains all the components that have been enabled in IIS.
Determining if asp.net is even an installed feature (prerequisite for enabling it) can be done through PowerShell, which implies there is .net api out there for it if you dig hard enough. The PowerShell methods:
Import-Module servermanager
Get-WindowsFeature web-asp-net
Which will return an object of type Microsoft.Windows.ServerManager.Commands.Feature. The installed property is boolean and indicates whether or not the feature is installed.
So do you want the easy way? Make a nice pretty .aspx page that displays as HTML with an error block in a div in a placeholder saying "You need to install ASP.NET" and have it change on ASP.NET being installed to instead say "ASP.NET is installed" and then just have the tool launch this webpage in the default browser after copying it to the directory identified in IIS as the *:80 site (or create the directory mapping in IIS programmatically by altering the XML and then removing it later)
May not be the most elegant but it does ensure that testing shows what features are truly installed versus what's in an XML file.
Because that will scream "do it the lazy ignorant way" I'll remind you that the only way for me to know in javascript what features I can use is to test them before I try to use them, or assume they're there and watch it blow up. My point is, it doesn't matter what gets reported in a file, it matters what you can actually use. Just because C:\Windows\Micrsoft.Net\Framework\v3.xxxxxxxx exists and has files doesn't mean the dll's are registered in the GAC, does it?

Subsonic SQLite Multiple Files

I have an application that must be accessed for many users.
To optimize the performance I intend to store each user profile information at a independant database file.
I need everytime a user login the application, to setup a new provider linked with his own database.
All databases have the same structure. So while querying user the commom generated DAL classes must switch for the database file relative the the user.
Is there a way for configure SubSonic for doing that switch at runtime?
Thanks.
Well, assuming we 're talking about SubSonic3:
I have made a patch for this and logged it as an issue in the SubSonic Templates project on github, where the source is available. You can find the issue (and a link to the code) here.
After you apply the patch, you will have a new DefaultDataProvider property which does exactly what you want. Use it like this (e.g. after a user logs in):
YourSubSonicGeneratedNamespace.YourDatabaseName.DefaultDataProvider =
SubSonic.DataProviders.ProviderFactory.GetProvider(
"your connection string here",
SubSonic.DataProviders.DbClientTypeName.SqlLite);
And you 're good to go.
For SubSonic 2, this answer sounds like what you want.
With subsonic 2 I use an approach where I inject the provider at runtime rather than loading it from the app.config file.
Look at my answer here: Subsonic in a VS2008 Add-In woes
Instead of just using one provider you could create one for every user who starts the application and change the default provider as needed.

Resources