How to configure callbackhandler for custom realm in Glassfish? - glassfish-3

I configured new custom realm for Glassfish v3 and deployed it. No errors founded on logs where Glassfish start.
Now I want to test my realm with simple dynamic web project but I don't remember how to configure callbackhandler to get login/password for users ? I believed that there was tag balise on web.xml or glassfish-web.xml to configure it but I can't find it.
Please help me to set up callbackhandler in my case :)
Olivier

Related

How can I change a setting in appsettings.json after auto-deploy?

I have an ASP.NET Core application going on an have setup Github auto-deploy on it. But since it's an open repo I obviously don't want to upload my correct configuration file.
What I'd like to do is to replace some strings in the appsettings.json after a github auto deploy.
"AppSettings": {
"Token": "my super duper secret token"
}
How can I change my super duper secret token to my real token after a github deploy on Azure?
As I know we can config token in App Settings on the Azure port.
I do a test on this, it works successfully, the following is my detail steps.
Create an Asp.net core Application.
Add [AppSettings] section in the appsetting.json file (Token vaule: mysecretkey).
Add a public class AppSettings.cs under the created project.
Add the code services.Configure<AppSettings>(Configuration.GetSection("AppSettings")) in the function ConfigureService function in the Startup.cs file (For .net Core 1.0).
Note:The syntax for model binding has changed from RC1 to RC2. Using services.Configure<AppSettings>(Configuration.GetSection("AppSettings")), is no longer availableIn order to bind a settings class to your configuration you need to configure this in the ConfigureServices method of Startup.cs:
services.Configure<AppSettings>(options => Configuration.GetSection("AppSettings").Bind(options));
5. Add code to the HomeController.cs file.
Publish the WebApp to the Azure Portal.
Add [AppSettings: Token] in the Azure Portal.
Browse the WebApp and select the about tab to see the token value is that the value set in the portal.
Assuming the web site already exists as a resource in Azure, you can simply set the App Settings/Connection strings in the portal. These will override the ones in the appsettings.json file at runtime. Ie. your app will first look at the azure app settings/connection strings before looking for them in the local file. This is part of asp.net core's "cloud first" approach to configuration management. These settings wont get overwritten when you deploy code to the app/slot.
Found a blog post here which describes it in a bit more detail, using the .AddEnvironmentVariables() call to add azure slot settings to the configuration.
There is a code editing functionality in developer tools settings (Settings -> Development Tools -> App Service Editor (Preview)). You can go there and change any file you like in there. But you probably will need to restart the web application (by editing web.config or some other way).. You can also use Kudu (Advanced Tools) for that, but it's not as pleasant UI as Visual Studio Code in the first option.
Though the more advanced and correct way of dealing with application secrets is the special secret manager. You can read more about it on asp.net documentation here.
Generally it's a way to load the secrets from a protected data storage and override them with environmental variables in production (can be set in azure web app).
If you are using Azure DevOps Release to deploy, you can easily specify properties for each environment/stage.
You can use the task File Transform and indicate the path to appsettings.json:
Or if you are deploying directly to Azure:
So you just need to create the variables to override the data in the settings:

Adding a realm in Websphere Linux 8.5.5.4 Server

Need a help on how to add a realm for a example.
com.worklight.integration.auth.AdapterAuthenticator
How should i put this realm to server?
That's got nothing to do with your application server.
You define Realms in the MobileFirst project that you created using either MobileFirst Studio or the CLI tool (in which case you then edit a file in whichever code/text editor of your choosing).
In both cases the file to edit is called authenticationConfig.xml and is located in the your-project\server\conf\ folder.
Before touching this file, though, you should familiar yourself with the authentication concept in MobileFirst Platform because you do not simply "add a realm". You are required to also configure its associated Login Module and security tests as well as actually utilize it somewhere in your application's logic.
Please read:
Developer Center: Authentication and Security
Knowledge Center: MobileFirst Security Framework
The tutorials and documentations topic above will also lead you to Adapter-based authentication, which is what you are supposedly actually looking for.

How to enable OS-KSADM Admin Extension in openstack?

I am new to openstack and I am working on tenant management in openstack icehouse though restful api, and realized I need to enable OS-KSADM extension.
If I invoke my local openstack instance by the url: http://xx.x.x.x:5000/v2.0/extensions
I will get response of the list of the extensions including "OpenStack Federation APIs","OS-FEDERATION","OS-KSCRUD", "OS-EC2"....etc, but no OS-KSADM . I have googled around about it and could not find an example or detail config instruction.
What is the config change needed to enable this extension?
Thanks in advance
By default you have the Identity v3 API enabled, and the OS-KSADM extension is for Identity v2.0.
There are a couple of blog posts about enabling the v2 API:
http://www.symantec.com/connect/blogs/how-switch-keystone-v20-v3
https://www.mirantis.com/blog/manage-openstack-projects-using-domains-havana/

Host WCF in a Windows Forms application

I have created a WCF service (DLL file), and I can use it when adding a service reference to it from my "adjacent" project in the solution.
I wish to make this WCF service accessible / host it, in a Windows Forms application. I need to use it from a remote location and need to access it via a URI. (IP address : Port !?)
What I am unsure of, is how to host it in the Windows Forms application? I have gone though many examples, but I can't quite get behind what needs to be done...
Do I add the DLL file reference to a new Windows Forms application, and somehow "shell" the DLL file?
Can I change my WCF service project type to a Windows Forms project? What needs to happen here?
I would appreciate some basic examples, that I could build upon. I have no preference for binding, but although I will now be accessing it from another remote Windows Forms application, ultimately, it will be accessed/used by a remote ASP.NET web application.
For now, I need to get it working on:
Remote Windows Forms application <---> (server) WCF service (hosted in its own Windows Forms application)
How can I do this?
If I understand correctly, rather that ASP.NET, it sounds like you are looking for self-hosting. See How to: Host a WCF Service in a Managed Application.
Your service can stay in its own class library; you only need to instantiate it from a Windows Forms project. For example, copy that Program.Main() into your Program.cs, replacing the...
Console.WriteLine("The service is ready at {0}", baseAddress);
Console.WriteLine("Press <Enter> to stop the service.");
Console.ReadLine();
...lines with the...
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
...ones typically included in a Windows Forms project.
Try this...
Add the DLL file reference of your already-created WCF library to the new Windows application project and on any event, like a button click, try the following code.
ServiceHost sh = new ServiceHost("http://localhost:9092/MyService")
sh.open();
You can refer to the article Four Steps to create first WCF Service: Beginners Series.

service discovery during "Add Service Reference"

i'm building an Asp.Net app (contains the service) with Silverlight control (need to use the service) and having a problem after i discover the service and press OK button, can anyone help me please?
Try/Check the following:
Your service project is being properly build with no errors.
There is no other IIS / IIS express servers running in background.
Try to open the service address that you are trying to consume in the browser and see if it is loaded OK.
This should give you a lead on the problem.

Resources