smtp configuration for zend framework to connect my own domain - zend-mail

I am now using zend framework and want to send email using my own domain.I set the configuration like this.How can i connect the smtp using my domain not gmail.My error is :
5.7.8 Username and Password not accepted. Learn more at
5.7.8 https://support.google.com/mail/answer/14257 da3sm19328626pdb.8 - gsmtp
My code is :
class MailService{
private $sender ="admin#mydomain.com";
private $password="mypassword";
public function configSmptpOptions(
'name'=>'test',
'host'='>mail.mydomain.com',
'port'=>587,
'connection-class'=>'login',
'connection-config'=>array(
'username'=>$this->sender,
'password'=>$this->password,
'ssl'=>'tls'
)
);
}

Related

Can I use LDAP/AD authentication with Blazor Server when publishing to IIS

I built my first Blazor server application with a Login Controller and when I run the application on my local machine, I am taken to my Login page because I am not authorized. I can log in and authenticate with active directory just fine.
When I publish the application to my remote IIS server, I'm not prompted to log in, because it just grabs my DOMAIN\Username of my windows user.
I have a user service that I call to check the authentication state and return my username.
Is there a way for me to check whether I have a user that is authenticated within the web application, ignoring my signed-in windows user account? What I want to do is create an application where a user can log in from any device under their own windows account and submit a ticket.
public class UserService : IUserService
{
private readonly AuthenticationStateProvider _auth;
public UserService(AuthenticationStateProvider authenticationStateProvider)
{
_auth = authenticationStateProvider;
}
public string GetUser()
{
var provider = _auth.GetAuthenticationStateAsync();
return provider.Result.User?.Identity?.Name;
}
}

Is Spring Data LDAP generally intended for bind authentication?

I am trying to use Spring Data LDAP for users authentication using OpenLDAP server. However, search by uid and userPassword fails because the password is stored as SSHA hashed.
I wonder if really Spring Data LDAP can be used for users authentication because the tutorials usually concentrate on searching or they map password to some attribute other than userPassword.
#Entry(base = "ou=People", objectClasses = { "top", "person", "inetOrgPerson", "organizationalPerson", "simpleSecurityObject" })
public class LdapUser {
#Id Name dn;
#Attribute(name = "userPassword")
private String password;
/** The user id. */
#Attribute(name = "uid")
private String userName;
}
public interface ILdapUserRepo extends LdapRepository<LdapUser>{
public LdapUser findByUserNameAndPassword(String username, String password);
}
Your use-case isn't what Spring Data LDAP is intended for. Spring Data LDAP is intended to lookup objects from LDAP by querying these and updating LDAP entities.
Performing LDAP authentication requires authentication against LDAP directly by using the appropriate connectors.

Photon Secure WebSocket Connection In Unity WebGL

I'm having trouble when I try to connect my local Photon Server with Unity3D WebGL Build, using secure websocket connection. I can establish the connection with websockets (not the secure one) and any other environment other than WebGL builds (Even in Unity's play mode with WebGL configuration, it just won't work when I get a build). I'm guessing that the problem is related with my certificate but I'm not entirely sure. I tried self-signed one, and a real one.
Here is the error:
WebSocket connection to 'wss://localhost:19091' failed: Error in
connection establishment: net::ERR_INSECURE_RESPONSE
I already tried 127.0.0.1 instead of localhost, tried to change the port.
I got my socket code from Photon's website, link is here:
https://www.photonengine.com/sdks#onpremiseunity3d
My Client code(uses Photon's SocketWebTcp class) is like this:
using ExitGames.Client.Photon;
using UnityEngine;
public class HiveClient : IPhotonPeerListener
{
public PhotonPeer PhotonClient { get; set; }
public HiveClient() { }
public void Connect()
{
this.PhotonClient = new PhotonPeer(this, ConnectionProtocol.WebSocketSecure);
this.PhotonClient.SocketImplementationConfig.Add(ConnectionProtocol.WebSocketSecure, typeof(SocketWebTcp));
this.PhotonClient.Connect("wss://localhost:19091", "Hive");
}
public void DebugReturn(DebugLevel level, string message)
{
Debug.Log("DebugReturn: " + level.ToString() + " Message: " + message);
}
public void OnEvent(EventData eventData)
{
Debug.Log("OnEvent: " + eventData.Code);
}
public void OnOperationResponse(OperationResponse operationResponse)
{
Debug.Log("OnOperationResponse: " + operationResponse.DebugMessage);
}
public void OnStatusChanged(StatusCode statusCode)
{
Debug.Log("OnStatusChanged: " + statusCode.ToString());
}}
Here is app's websocket listener in photon server config:
<WebSocketListeners>
<WebSocketListener IPAddress="0.0.0.0" Port="19091" DisableNagle="true" InactivityTimeout="10000" Secure = "true" StoreName = "MY" CertificateName = "DESKTOP-PQ845BC" UseMachineStore = "true">
</WebSocketListener>
</WebSocketListeners>
Lastly, here is my self-signed certificate:
Thank you.
Solved this, It seems certificates doesn't work with ip adresses like 127.0.0.1. Certificate expects some address (like xxx.photon.com)
As a temporary solution, one can send a https request to defined ip and insert the ip chrome's allowed ips. This temp solution relates to this answer:
https://stackoverflow.com/a/43493521/3013806

How to access authenticated user in other than Authentication Controller in Grails?

I am using Authentication 2.0.1 spring security plugin to authenticate my web services . I am in success to login and set user session through Authentication Service . I also get sessionUserand isLoggedIn in success response in Authentication controller. But same thing I am not able to access from other controller.Please have a look into my code , I am not able to access authentication service in other than authentication controller , Please help.Thank in advance.
class ModuleController {
def authenticationService
def beforeInterceptor = [action: this.&auth]
private auth() {
println 'checking authentication in module controller : '+authenticationService.isLoggedIn(request)
}
}

Setting client credentials using ESB dynamic send port username password over HTTPS

I need to POST to a hrl https://xxxxx.com which expects a username and password BAsic authentication
We are using biztalk ESB dynamic send port
How do I configure this using binding configuration or behaviours
or can I set this from UDDI
For WCF adapter you can set any WCF adapter properties in ESB Endpoint Configuration.
In your case it should be something like this:
SecurityMode=TransportCredentialOnly&TransportClientCredentialType=Basic&UserName=Youruser&Password=Yourpassword
It's not good to store them in clear text though. You can use SSO instead: just use UseSSO and AffiliateApplicationName.
Your problem can be solved using custom endpoint behavior too. You should register it in machine.config to use from ESB. In behaviour you should have something like this:
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "user";
clientCredentials.UserName.Password = "password";
bindingParameters.Add(clientCredentials);
}