Authentification with Login and Password

59 views
Skip to first unread message

Rayane

unread,
Jul 11, 2024, 11:55:18 AM (11 days ago) Jul 11
to Excel-DNA
Hi All, 

How would you go to create an authentification function with login and password with ExcelDNA ? 

What most simple tools would you use ? 

Thank you.

R.

Terry Aney

unread,
Jul 14, 2024, 9:19:57 PM (7 days ago) Jul 14
to Excel-DNA
Authentication to what service?  Obviously the UI could be created with a Windows.Form with couple of textboxes right?

For example, I require credentials to call some web services that my add-in leverages and I just made a simple form to prompt for them if not already present...

Screenshot 2024-07-14 191628.png

Terry Aney

unread,
Jul 14, 2024, 9:22:21 PM (7 days ago) Jul 14
to Excel-DNA
Forgot code, but pretty straight forward....'Credentials' is the name of my Windows.Form.

var currentUserName = AddIn.Settings.KatUserName;
var currentPassword = await AddIn.Settings.GetClearPasswordAsync();

using var credentials = new Credentials( GetWindowConfiguration( nameof( Credentials ) ) );

var info = credentials.GetInfo( currentUserName, currentPassword );

if ( info != null )
{
    await UpdateAddInCredentialsAsync( info.UserName, info.Password );
    SaveWindowConfiguration( nameof( Credentials ), info.WindowConfiguration );
}

Rayane

unread,
Jul 15, 2024, 9:15:59 AM (7 days ago) Jul 15
to Excel-DNA
Hello, 

Thank you for your reply. 

I'm planning to use Auth0 after I've done some research. Combine this with a Ribbon and Login button with Login/Password as you described. Once Login/Password validated, the Addin would be activated and user can access all its functions.

I'm looking for something really basic as I'm only building a POC (Proof Of Concept).

Any suggestions welcome.

Best regards, 

Rayane

Rayane

unread,
Jul 16, 2024, 4:04:20 PM (6 days ago) Jul 16
to Excel-DNA
I have a hard time implementing Auth0.... Anyone did it successfully ? 

Rayane

unread,
Jul 20, 2024, 9:55:08 AM (2 days ago) Jul 20
to Excel-DNA
Hi Terry, 
What do you use for authentification ? 
The UpdateAddInCredentialAsync must surely trigger connection to a remote server to check the credentials ?
Thank you.
Best regards, 


Le lundi 15 juillet 2024 à 03:22:21 UTC+2, Terry Aney a écrit :
Reply all
Reply to author
Forward
0 new messages