Using NLog in Winform application - protecting email password - winforms

I am incorporating Nlog into a winform application. I have been able to successfully configure targets and rules by xml and programmatically (C#). What I wish to do is define the targets and rules in xml but protect my password for the gmail target. How can I define some targets in XML and add a gmail target programmatically? Or how can i add supplemental info - ie username and password to a target defined in xml?
Is there a way?

You can add to, edit or remove any xml/config defined targets in runtime via LogManager.Configuration.
So I can imagine you defining some of your targets in xml (e.g. File or Console) and add an email target via code with the encrypted password. Or maybe even define the email target but set the property 'password' of the email target programmatically.

Related

Send email with reset password link based on project

I have two projects where both of them use same firebase project. My problem is I want forgot password in both of the projects and both of them should point to different url in the respective project. Any help will be appreciated.
What I have achieved?
I have done forgot password for the first project and I get a email with link, for the second project I want email with different link (I am getting same link).
Any help will be appreciated.
There is only one password reset template per Firebase project, so you can't use the built-in template password reset flow to send different emails to different users in a single project. This usually isn't a problem, as the apps in a Firebase project are meant to be part of a single logical application.
If your use-case must use a single Firebase project, have a look at implementing a custom email handler, which is the page that the email links to.
If that is not enough, you can take control of the complete password reset flow yourself. This gives you full control of the emails that are sent, but does mean that you also have to arrange how to send that email and all actions from it yourself. For the actual password change, you'd then typically use the Admin SDK to update the user profile in a trusted environment.

How to apply S/MIME certificate to Outlook programatically (Windows, C/C++)

We wish to automate the process of applying a S/MIME certificate to Outlook so that it can be used for Signing and Encrypting of email. We want to be able to programmatically set security setting preferences for: the signing & encryption certificate and their corresponding algorithms.
Can we make use of Outlook MAPI or the Graph API for this purpose? Which call / field (group) should we use? Our preference is to use a C/C++ API.
For anyone trying to do the same, the following script is great (or a great place to start) for setting an S/MIME certificate to Outlook including the required settings.
https://github.com/glueckkanja-pki/PKI-Configuration-Tools/blob/master/ActivateSignatures.ps1
The scripts edits the registry entry which contains the Outlook security settings. You can run the Powershell script using 'system("start [...]")' or 'CreateProcess' for example.
To answer the subquestions: I have not found a way to do this through either Outlook MAPI nor Graph API. The registry entry is: HKEY_CURRENT_USER\Software\Microsoft\Office\"version, 16.0 for me"\Outlook\Profiles\"Profile Name"\c02ebc5353d9cd11975200aa004ae40e

Database with Application

I am developing a desktop application. Multiple users shall be using it to insert, delete and select data from database. As users shall be using it so they would not have to login to database.
I know how to use JDBC (for Java Applications), I need suggestions that I don't want to hard code the credentials of database like host address, username, password ... etc. So if change of credential is needed I can change it without changing the code. Also, I cannot just put database credentials in a text file and read every time when the application need to interact with database.
You can create a ApplicationConstants file which will store the host address, username and password.
If you need to change it you'll have to change it only in one location.
But this will require you to compile the code everytime you make changes.
The alternative is to encrypt the values and store the encrypted values in a text file.
You can use the javax.crypto for encryption/decryption. You can find an example on the following link :
Simple java AES encrypt/decrypt example

Is Azure Active Directory extension property searchable

user story: a anonymous user should be able to create survey, paste in survey participants' email from their outlook, these participants will become valid user in AD, with their emails as primary search key as extension property in AD. User will get mail, being notified that a survey is ready for them......etc.
Since Azure Email property is only readable, I can only add the user mail as an extension property. When extension property such as "SkeypID", "Email" is added, the searchability is also available?
ex. DirectoryService.users.Where(it => it.myproperty!= null && it.myproperty.Equals('test#gmail.com')).SingleOrDefault();
Let's assume that I want to give access to anonymous user creating user in Active directory, (Sorry, did not try this one myself before asking), does it work without using a user identity as company administrator?
Yes, extension attributes are searchable. Use a query like the one referenced at the GitHub README for my OrgChart extensions sample application. The link should look something like this:
GET https://graph.windows.net/contoso.com/users/joe#contoso.com?api-version=1.21-preview&$filter=extension_d8dde29f1095422e91537a6cb22a2f74_skypeId+eq+'joe.smith'
To allow an anonymous user to create a user in ActiveDirectory you could create an application with write permissions to your directory and have that application allow anonymous access. My OrgChart extensions sample application allows you to create and delete users, but you need to provide it application credentials and a tenant where that app has write consent.

Creating custom user attribute on LDAP (LDS)

I am running a webapp that connects to LDAP (LDS). In the app, I need to check on the user class the value for the attribute userAccountControl.
In my installation my user class does not have such attribute, even though I imported the MS-User*.ldf files when creating my instance.
So, I need to create this attribute in the user class. I am using ADSI Edit to connect to my LDS instance, but it does not provide any facility to create new attributes. What should I do?
It's a two stage process, however you do it. First, you need to create the userAccountControl attribute. Then you need to add the name userAccountControl to the mayContain attribute on the user class.
You can create the userAccountControl attribute using LDIFDE or ADAM Schema Manager. ADAM Schema Manager gives you a GUI to do this work but has limited options. LDIFDE is a program you run against a text file. The nice thing about this is that you could run LDIFDE against your AD DS installation to export the userAccountControl attribute attributes [yes, I did mean to type it like that]. You can then remove the ones you don't need (e.g. the ones marked as systemOnly in the schema, for a start) and then import the modified file to your AD LDS instance. I can provide more info if it would help.

Resources