public AuthorizationTokenForm() { InitializeComponent(); GetTokenShipment = new GetTokenByAuthorizationCodeShipment(); AuthTokenEPFunc = new AuthorizationTokenEndPointFunctionality(); AuthTokenEPFunc.ReturnMessageXml += ReturnMessageXmlHandler; }
public AuthorizationAccessTokenResponseContainer GetSelfContainedToken(GetTokenByAuthorizationCodeShipment shipment) { var client = GenerateAuthorizationTokenProxy(shipment.EndpointName, shipment.Certificate); OperationContext = "AuthAccessTokenGet"; var accessToken = client.GetAccessToken(shipment.Username, shipment.Password, shipment.AuthorizationCode, shipment.SelfContainedToken); SecurityToken validationResult = null; if (shipment.SelfContainedToken) { validationResult = ValidateToken(shipment.SpiCertificate, accessToken.SelfContainedToken); } return(new AuthorizationAccessTokenResponseContainer() { UnwrappedToken = validationResult, SelfContainedToken = accessToken.SelfContainedToken, ReferenceToken = accessToken.ReferenceToken }); }