DNN SendGrid confuguration is NOT working - smtp

I am using DNN 9.1 and I am trying to set the SMTP configuration by my SendGrid username and password, but this error always appears.
FYI, my old account was working properly but it stopped working suddenly, I created a new one and added it to the DNN and the same issue still appears, any suggestions?
Edit
I found this error log in the DNN admin logs portal
AbsoluteURL:/API/PersonaBar/ServerSettingsSmtpHost/SendTestEmail
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:c3cbbedf-c450-4c50-82ad-3bc0f946d8fe
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:FbT04vCDY1wSj04IwamtapyPstw=
Message:Unable to read data from the transport connection: net_io_connectionclosed.
StackTrace:
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message)
InnerMessage:
InnerStackTrace:
Source:System
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Server Name: yoga-van-devweb1

Twilio SendGrid developer evangelist here.
You say that you configured your SMTP settings with your username and password, however SendGrid recently changed the requirements for this. Usernames and passwords are no longer accepted and you should use an API Key instead.
Check the documentation for using a SendGrid API Key with SMTP here.
Briefly, instead of your username and password, you should use the username apikey and the password should be an API Key you generate with mail send permissions.
Let me know if that helps at all.

Related

web3js signing the message using private key

I tried using web3.eth.accounts.sign('hello', 'PrivateKey') to sign my message and used web3.eth.accounts.recover(signatureObject) to recover the address
but it does not return me the correct address. I am using web3 version : 1.0.0-beta.34. Any help ?

XMPPError:forbidden auth error while creating new user using smack 4.1.2

I am trying to create user using smack client 4.1.2. I am getting below error.
Send XML on stream = <<"<iq from='abc.example.com' to='admin#abc.example.com/Smack' id='Dym8b-14' type='error'><query xmlns=jabber:iq:register><password>xxxxxx</password><username>user</username><registered/></query><error code=403 type=auth><forbidden xmlns=urn:ietf:params:xml:ns:xmpp-stanzas/></error></iq>">>
My ejabberd config looks like below (.yml file)
register_from:
admin: allow
...
access_from: register_from
access: register
I am still getting above error. Please help
Adding code snippet to show how I create new user using smack 4.1.0
connection = new XMPPTCPConnection(getConnectionConfiguration());
connection.connect();
connection.login("admin", "admin");
if(connection.isAuthenticated())
{
AccountManager accountManager = AccountManager.getInstance(connection);
accountManager.sensitiveOperationOverInsecureConnection(true);
accountManager.createAccount(userName, password);
connection.disconnect();
// The account has been created, so we can now login
connection.login(userName, password);
}
private XMPPTCPConnectionConfiguration getConnectionConfiguration()
{
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setServiceName("abc.example.com")
.setHost("abc.example.com")
.setPort(5222)
.build();
return config;
}
I found the issue. It was due to trusted_network tag had value as loopback:allow in ejabberd config file. I changed it to all:allow. It started working.
The snippet of configuration you provide is too small and badly indented, so it is impossible to tell you what is wrong in your configuration.
However, considering your config is correct, you should check that your user is properly authenticated with the right ACL credentials before sending the register request. Most client libraries assume self user registration and try to send the register before doing any form of authentication.

Setting connection string programmatically to obscure db password

I am using a TableAdapter in a dataset in Vb.net winforms (connected to a mysql server) to allow integration of a Devexpress scheduler - I have been using this method for some time; while I know of many of the security flaws of vb.net including decompiling and packet sniffing plain text communication; I am trying to lock down security as much as I can which brings me to my current problem.
The dataset was set up to connect using the .net framework data provider for mysql which requests a Server address, username, password, and DB file - I then get the option of "saving the login credentials in the connection string" or "setting the login credentials in my programming code" for sake of time previously I saved the login credentials.
this adds a setting file (connectionstring)
server=mysqlserveraddress.com;user id=mysqluser;password=mysqlpassword;database=mysqldb;persistsecurityinfo=True
which also means these credentials are saved in plain text in the installation folder for my program
I am trying to transition to including this connectionstring in my programming code however I do not know how to approach it - for non-dataset transactions I have already declared public const in a module which includes the credentials
'database variables
Public Const dbserver As String = "mysqlserveraddress.com"
Public Const dbuser As String = "mysqluser"
Public Const dbpassw As String = "mysqlpassword"
Public Const dbfile As String = "mysqldb"
and I create the connections when needed.
How do I programmatically enter the connection string so it is not visible to the lay-person.
Are you saying that you want to to set the user id and password attributes of an existing connection string at run time? If so then you can use the appropriate connection string builder. I don't use MySQL and Connector/Net but it should look something like this:
Dim builder As New MySqlConnectionStringBuilder(partialConnectionString)
builder.UserId = userId
builder.Password = password
Dim fullConnectionString As String = builder.ConnectionString
Anyone who decompiles your code is going to see that data though. You might consider just storing the whole lot in the config file but encrypting it. For more info on that, check this out:
http://www.vbforums.com/showthread.php?532768-NET-2-0-Protected-Configuration-(Encrypting-Config-Files)

Cannot open log for source 'Microsoft.Practices.EnterpriseLibrary.Data'. You may not have write access When Read/Write to Event log

i'm working on a SharePoint 2013 site, i have 2 type of registration: (Win Authentication and FBA).
I'm trying to use a solution (WSP) from the old portal (SP 2010), this WSP use a dll named 'Microsoft.Practices.EnterpriseLibrary.Data' which isn't existed in SP 2013 environment.
So to resolve that i installed the Microsoft Enterprise Library 5.0 from Microsoft, then i copied this dll to the bin folder under inetpub\wwwroot\wss\VirtualDirectories\80\
Now when i logged in to site using windows authentication mode the WebPart appear but when logged as FBA User the an error appeared:
System.InvalidOperationException: Cannot open log for source 'Microsoft.Practices.EnterpriseLibrary.Data'. You may not have write access. ---> System.ComponentModel.Win32Exception: Access is denied
--- End of inner exception stack trace ---
at System.Diagnostics.EventLogInternal.OpenForWrite(String currentMachineName)
at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type)
at ProjectName.Internet.EventViewerLogService.LogEvent(String source, String message, EventLogEntryType type)
at ProjectName.Internet.ExceptionHandler.Handle(Exception exception)
at ProjectName.Internet.SQLHelper.GetVolunteerInfo(String VolunteerId)
at ProjectName.Internet.Profiles.Volunteer.GetVolunteer(String VolunteerId)
at ProjectName.Internet.Accessibility.Accessibility.AccessibilityUserControl.Page_Load(Object sender, EventArgs e)
Note: i tried to give permission to "Security" into the registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security to the 'Authenticated Users group' because i had an error in the beginning
Error: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
PS: This is a follow up to this . I followed the given answers but to no avail.
I guess this is due to some configuration issue on server?
The error is related to permission issue, when i logged in with FBA User i missed the permission to write into new event Sources.
By default, any authenticated user is able to write to application event log. However only administrators can create new event Sources.
I resolve it by run the CreateEventSource method with elevated Privileges, like the below:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
if (!EventLog.SourceExists(eSource))
{
EventLog.CreateEventSource(eSource, eLog);
}
EventLog.WriteEntry(eSource, ex.ToString(), EventLogEntryType.Error);
});

SQL Agent and Web.Config. WAS: SSRS Forms Authentication, Running subscriptions

I have successfully implemented Forms Authentication in SSRS, so it now uses both Roles and Users from my website, using the ordinary asp.net membership framework.
I can log in to the portal and run any report, as long as I have the correct role from my original app. All good.
However, if I create a subscription, then, when the subscription runs, I don't get my report, but rather this message in the log:
subscription!WindowsService_0!161a0!10/21/2009-22:42:05:: i INFO:
Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException:
An internal error occurred on the report server. See the error log for more details. --->
System.Configuration.Provider.ProviderException:
The Role Manager feature has not been enabled.
at System.Web.Security.Roles.EnsureEnabled()
at System.Web.Security.Roles.GetRolesForUser(String username)
at MyApp.ReportServer.Security.Module.Authorization.CheckAccess(String userName, IntPtr userToken, Byte[] secDesc, ReportOperation requiredOperation)
at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType catItemType, Byte[] secDesc, ReportOperation rptOper, String reportPath)
at Microsoft.ReportingServices.Library.SecurityRequirements.CheckAccess(ItemType itemType, Byte[] securityDescriptor, String itemPath)
at Microsoft.ReportingServices.Library.DefinitionLoader.GetParameterDefinition(CatalogItemContext itemContext, String historyId, Boolean forRendering, SecurityRequirements requirements)
at Microsoft.ReportingServices.Library.RSService.GetReportParameters(ClientRequest session, CatalogItemContext reportContext, Boolean forRendering)
at Microsoft.ReportingServices.Library.RSServiceDataProvider.GetParameters(ClientRequest session, CatalogItemContext reportContext)
at Microsoft.ReportingServices.Library.RenderForNewSession.GetReportParameters()
at Microsoft.ReportingServices.Library.RenderForNewSession.GetReportMetadata()
at Microsoft.ReportingServices.Library.RenderForNewSession.get_ExecuteExistingSnapshot()
at Microsoft.ReportingServices.Library.RenderForNewSession.GetExecutionStrategy()
at Microsoft.ReportingServices.Library.ReportExecutionBase.InternalExecuteReport()
at Microsoft.ReportingServices.Library.ReportExecutionBase.Execute()
at Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
--- End of inner exception stack trace ---
The MyApp line is my custom security extension.
I have the RoleManager and membership provider setup in web.config in the /ReportServer directory.
Does the subscription runner circumvent the website settings somehow?
UPDATE:
Ok, so I found out, that apparently it is running with whatever is values is set in MACHINE.CONFIG when a subscription is being evaluated/triggered by sql agent.
Any clues why it doesn't use the web.config settings, but goes straight to machine.config?
I not formiliar with SSRS, but I am with .NET / membership providers and web/app/machine.config.
Your exception states subscription!WindowsService_0!161a0!10/21/2009-22:42:05::
I think this means the subscription service is a windows service and doesn't run in IIS. This means it has a different configuration file.
http://reportserver -> IIS -> web.config (Your configuration)
subscription!WindowsService -> Services -> app.config -> machine.config.
Hope it helps.