Skip to content

Save ERP Credenials in Vault Options #138

@PatrickGrub

Description

@PatrickGrub

Details

The dummy plugin uses no credentials at the moment to communicate afterward with the ERP.

UseCase

  • User can save/change the credentials via a dialog where the password is hidden by clicking in the vault toolsbar "powerGate->Credentials". Material in project EMPL for the dialog
  • The ERP credentials should be saved in the Vault Options
  • The client must transfer in Connect-ERP the credentials
  • The dummy plugin must read the User and Password from the request see Ticket 3797

Example for plugin read credentials

Extend powerGateServer config:

<behaviors>
      <serviceBehaviors>
        <behavior>
          <log4net />
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom"
               customUserNamePasswordValidatorType="WCF_UserAuthentication.UserAuthentication, WCF_UserAuthentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> 
          </serviceCredentials> 
        </behavior>
      </serviceBehaviors>
</behaviors>

Im Plugin ist es zu erweitern, das wird für jeden Service verwendet:

using System;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
 
namespace WCF_UserAuthentication
{
  public class UserAuthentication : UserNamePasswordValidator
  {
    public override void Validate(string userName, string password)
    {
      if (userName == null || null == password)
        throw new ArgumentNullException();
      if (!(userName == "coolOrange") || !(password == "coo!Orange"))
        throw new SecurityTokenException("Unknown Username or Password");
    }
  }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions