MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

User registration, OAuth and install from zip (Closed) (Mono Support )

Viewed 105717 time(s), 27 post(s) 5/28/2014 8:14:01 AMby PsMaster

Related topics

PsMaster

PsMaster

6/26/2014 8:11:50 PM
OK, finally fixed the mail problem!!! The final SMTP config:
<add key="EnableSmtpSSL" value="false" />

<mailSettings>
      <smtp deliveryMethod="Network">
        <network host="mail.somedomain.com" userName="mail@somedomain.com" password="somepass" port="25" />
      </smtp>
    </mailSettings>

Seems removing the "from", "enableSsl" and "defaultCredentials" values fixed the problem.
This content has not been rated yet. 
95 Reputation 13 Total posts
PsMaster

PsMaster

5/28/2014 8:14:01 AM
Hello,
I have a few problems. I'm using Arvixe web hosting and MonoX version 4.9.40.4907.
Problems:
1) If I install MonoX from Arvixe control panel almost everything works fine, but if I install from .zip package the pages will not register and don't appear in the list in administration area. If I go to files view and double click the pages they will only then be registered in the pages list. Not a big problem, but kind of annoying.

2) User registration. So I choose to install from Arvixe and after changing smtp settings and the rest of the web.config file I try to register as a new user. Right after registration I get an error: "An error has occured in the application. This event has been logged and will be addressed by the maintenance department. We appreciate your patience.". OK, so the user gets created, I can see it in the users list, but the user never gets an email. The smtp settings are good as I'm using the same ones for user registration from my other website. Any suggestions? Or maybe someone can point me to where the error log is?

3) OAuth. So I registered my application on social websites (LinkedIn, Facebook, Google, Twitter), I entered the ConsumerKey and ConsumerSecret in web.config, even made sure ApplicationTitle is the same when registering the app, but NONE of the logins through social sites work. My guess is OAuth 2.0??? Or am I missing something in the .config maybe?
Facebook: Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
Google+: OpenID auth request contains an unregistered domain "http://subdomain.mydomain.com".
Twitter: redirects back but MonoX and gives an error: Unable To Connect To Specified Social Network. An error occurred while executing http://api.twitter.com/1.1/users/show.json?user_id
LinkedIn: MonoX error: An error has occured in the application. Nothing more...
Facebook and Google+ I guess I need some more configuration from those sites? Twitter and LinkedIn, no idea what's wrong with those...

Thank you for your replies/suggestions.
New MonoX user.
This content has not been rated yet. 
95 Reputation 13 Total posts
PsMaster

PsMaster

5/28/2014 12:59:38 PM
Got another problem now:
I create a new user and when I try to upload an avatar with that user logged in I get an exception:
An exception was caught during the execution of an action query: The
INSERT statement conflicted with the FOREIGN KEY constraint
"FK_UserAvatar_aspnet_Users". The conflict occurred in database
"***dbname***", table "dbo.aspnet_Users", column 'UserId'.
The statement has been terminated.. Check InnerException, QueryExecuted
and Parameters of this exception to examine the cause of this exception.
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery
queryToExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PersistQueue(List`1
queueToPersist, Boolean insertActions) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2
entityToSave) at MonoSoftware.LLBLGen.Repository.SaveEntity(IEntity2 entityToSave)
at MonoSoftware.MonoX.ModuleGallery.UserAvatar.SaveAvatar(AvatarPostedFile
postedFile) at MonoSoftware.MonoX.ModuleGallery.UserAvatar.#AP(FileInformation
fileInformation)at MonoSoftware.MonoX.Controls.CropImage.OnImageResized(Byte[]
croppedContent, Byte[] originalImageContent) at MonoSoftware.MonoX.Controls.CropImage.#wP(Object sender, EventArgs e) at MonoSoftware.MonoX.Controls.StyledButton.OnClick(Object sender,
EventArgs e) at MonoSoftware.MonoX.Controls.StyledButton.#Ho(Object sender,
EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) at System.Web.UI.Page.ProcessRequestMain(Boolean  includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UserAvatar_aspnet_Users". The conflict occurred in database "***dbname***", table "dbo.aspnet_Users", column 'UserId'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection, Action`1 wrapCloseInAction) at  System.Data.SqlClient.SqlInternalConnection.OnError(SqlException  exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior,  SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString) at  System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean  async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1
completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
This content has not been rated yet. 
95 Reputation 13 Total posts
khorvat

khorvat

5/29/2014 10:15:24 AM
Hi,

thanks for you feedback, let me try and answer on few of your questions:

"1) If I install MonoX from Arvixe control panel almost everything works fine, but if I install from .zip package the pages will not register and don't appear in the list in administration area. If I go to files view and double click the pages they will only then be registered in the pages list. Not a big problem, but kind of annoying. "
I suppose you have refused to install demo data, now you don't have registered demo page any yes you need to register them manually. You may try to use one of the tricks in order to register them. Go to administration area -> Pages admin -> Right click on the page list (empty or not) -> Test pages 

"2) User registration. So I choose to install from Arvixe and after changing smtp settings and the rest of the web.config file I try to register as a new user. Right after registration I get an error: "An error has occured in the application. This event has been logged and will be addressed by the maintenance department. We appreciate your patience.". OK, so the user gets created, I can see it in the users list, but the user never gets an email. The smtp settings are good as I'm using the same ones for user registration from my other website. Any suggestions? Or maybe someone can point me to where the error log is?"
Can you please send us the smpt configuration so we can review and get back to you ?

We will get back to you shortly regarding the 3) and error above. 

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
pajo

pajo

5/29/2014 10:45:42 AM
Hi,

Regarding social login issue, all providers are returning same error, domain registered on provider doesn't match your domain. Domain registered with each provider must match domain of your running site. If you're running site on www.mydomain.com you need to enter this address on each provider. 
This content has not been rated yet. 
629 Reputation 83 Total posts
PsMaster

PsMaster

5/29/2014 12:40:59 PM
Thank you for the replies,
after some more configuration on facebook I managed to get it to work, so just probably need to adjust some setting for the apps on other social websites.

Other issues:
1) current smtp configuration:
<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="info@mydomain.com">
        <network host="mail.wisteria.arvixe.com" userName="info@mydomain.com" password="password" port="26"
         enableSsl="false" defaultCredentials="false"/>
      </smtp>
    </mailSettings>
  </system.net>

2) User avatars seem to be messed up for some strange reason. Installed through Arvixe, changed admin username, upload image for my profile, but the image didn't show up. Created another admin user, now I try to upload the same image for the new user, I get the exception that I mentioned before. Tried to upload a few more times, but got same exception. Now I go to the database UserProfile table and insert firstname and lastname manually. I try to upload the image again through interface, the image uploads fine, but is still not visible. Now I create another simple user (not admin) and when I go to my profile I see the image I uploaded before with admin account??? Now after logging in through facebook I go to my profile and see the same image yet again. Uploading a new image as a user still displays the first uploaded image. The avatar image does not show up for admin users, unchecked "is anonymous" checkbox too, doesn't change anything.

UserProfile table (just important columns):

[Id] [FirstName] [LastName][MyStatusPrivacyLevelId]
7916E298-2B4B-4940-87EE-A339004D4542 Name1 Last1 9762CB50-0FF3-4DC5-9942-56033CD2D021
3AFC435E-C113-4F00-B3B4-A339005286E2 Name2 Last2 NULL
8FF9F16C-4612-44D1-8D41-A339006F0B34 NULL NULL NULL
DC12657D-C67D-4771-9921-A33900B66804 NULL NULL 9762CB50-0FF3-4DC5-9942-56033CD2D021
2D69732A-A580-4B6D-9DFA-A33900BA037E NULL NULL 9762CB50-0FF3-4DC5-9942-56033CD2D021
18192C19-2D07-4F1E-B891-A33A003F03BA Name3 Last3 NULL
2F0E0C9A-94F2-4DA3-A63D-A33A0046FD7C NULL NULL NULL
67C919E2-8DF4-476A-B312-C26F82A36CFB Name4 Last4 9762CB50-0FF3-4DC5-9942-56033CD2D021

UserAvatar table
[ID] [Avatar]
3AFC435E-C113-4F00-B3B4-A339005286E2     Base64 code 1
DC12657D-C67D-4771-9921-A33900B66804     Base64 code2
2D69732A-A580-4B6D-9DFA-A33900BA037E     Base64 code2
18192C19-2D07-4F1E-B891-A33A003F03BA      Base64 code2
2F0E0C9A-94F2-4DA3-A63D-A33A0046FD7C    Base64 code 1
67C919E2-8DF4-476A-B312-C26F82A36CFB     Base64 code 1
This content has not been rated yet. 
95 Reputation 13 Total posts
idrazic

idrazic

5/29/2014 4:27:41 PM
Hello,

>>  changed admin username
Regarding the upload issue, please only change usernames if you know what you are doing (Preferably during install).
If you want to customize your display name, use "/profile-about/admin/"

Regarding the new user registration, please attach logs from "\MonoX\ApplicationData\Logs\*_MonoX.log" or set custom errors "Off" in the web.config so we can see full exception message.


This content has not been rated yet. 
1384 Reputation 152 Total posts
PsMaster

PsMaster

5/29/2014 7:55:07 PM
I did change the admin username from admin control panel, but not sure why it would disrupt the image upload, since I don't see any constrains, triggers or keys associated with the username, or why it would influence other user.

Attached the files, after reading through logs I see there's an error authenticating to the SMTP server.
"The SMTP server requires a secure connection or the client was not authenticated."
Double checked the logins and passwords and other settings, tried changing ports and setting enableSsl to true and false, but the result is the same, I get the same "An error has occured in the application." Though after changing enableSsl to true and after pressing register the server is taking about 2 minutes (instead of just a second) to return the same error.
Same smtp settings work on other applications (MVCForums) and some of my own that I use to send notifications.

On a side note, is there any way user passwords could be encrypted and not displayed for the admin users or stored in database as plain text?
I think asp.net Identity 1.0 and the new one 2.0 are doing it by default?

This content has not been rated yet. 
95 Reputation 13 Total posts
khorvat

khorvat

5/30/2014 8:24:26 AM
Hi,

can you please check the following:
- if appSettings in the web.config have the following set the false<add key="EnableSmtpSSL" value="false"/>
- do you have other sites on the Arvixe too ? Can you please check if they allow non secure connections ?

On a side note, is there any way user passwords could be encrypted and not displayed for the admin users or stored in database as plain text?
You need to configure the membership provider in the web.config similar to this:

<membership defaultProvider="AspNetSqlMembershipProvider" hashAlgorithmType="SHA1" >
  <providers>
    <remove name="AspNetSqlMembershipProvider" />
        <add enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="true" passwordFormat="Hashed" ........ name="AspNetSqlMembershipProvider" type="MonoSoftware.MonoX.MonoXMembershipProvider, MonoX" />
 </providers>
/membership>
Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
PsMaster

PsMaster

5/30/2014 9:39:17 AM
<add key="EnableSmtpSSL" value="false"/> it is set to false, changing value to true and toggling same setting on <mailSettings> enableSsl gives the same error.

I use non secure connections on other websites.

Thank you for the Hashed solution, probably will have to reinstall the application ant try again.



This content has not been rated yet. 
95 Reputation 13 Total posts
khorvat

khorvat

6/13/2014 7:21:22 AM
Hi,

did you manage to solve your issue with reinstalling the app ? All error logs point out that you need to have proper SMTP authentication

Error

"SMTP server requires a secure connection or the client was not authenticated. The server response was: SMTP authentication is required."

Let us know if you need more assistance.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
1 2 3