Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email verification docs #1063

Closed
thamer898 opened this issue Mar 16, 2016 · 53 comments
Closed

Add email verification docs #1063

thamer898 opened this issue Mar 16, 2016 · 53 comments

Comments

@thamer898
Copy link

Hello

I have parse 2.1.6 how to configure user reset password can you help me please ?

Regards

@felipeandradebezerra
Copy link
Contributor

I've the same issue, running the following code with the latest Parse Server results in {"code":1,"message":"Internal server error."}

[PFUser requestPasswordResetForEmailInBackground:@"[email protected]" block:^(BOOL succeeded, NSError *error) {}];

@thamer898
Copy link
Author

Hello @drew-gross

can you help us please to solve this issue ? to configure rest password using latest parse server edition ?

Regards

@noder199
Copy link

I am pretty sure this feature is experimental. No documentation about it yet.

@thamer898
Copy link
Author

Hello @noder199

yes i agree with you but i think there is a configuration smaple that mentioned in 2.1.6 v of parse server ?

Regards

@noder199
Copy link

Haven't done it myself, but take a look at #275 .

@thamer898
Copy link
Author

@noder199 i posted a question on #275 to query about the latest configuration details ?

@batkov
Copy link

batkov commented Mar 17, 2016

Ok guys,

I'm completely newbie to nodeJS. Setup following in index.js of my instance of parse-server-example%


var SimpleMailgunAdapter = require('parse-server/lib/Adapters/Email/SimpleMailgunAdapter');
var api = new ParseServer({
  ....
  emailAdapter: new SimpleMailgunAdapter({
    apiKey: 'apiKey got from mailgun.com dashboard',
    domain: 'domain got from mailgun.com dashboard',
    fromAddress: 'email'
  }),
 .....
});

And so it worked, but not completely:
I received broken email:
undefined/apps/V8JPb9vSVENYgxbJkSfoqVZwa2FkdRtucsYlTajK/request_password_reset?token=mT41QGAGnh65PcsHkyQ4pfysi&username=example%40example.com

I've tried to set http://myip:myport/servername instead of undefined manually, but it isn't working.
If you'll go further please notify me.

@felipeandradebezerra
Copy link
Contributor

It's working!

Key attributes: appName, publicServerURL, serverURL
Custom page: new_password.html on line 160 change to var base = "http://IP/parse"

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/data',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: '',
  masterKey: '',
  javascriptKey: '',
  restAPIKey: '',
  dotNetKey: '',
  clientKey: '',
  fileKey: '',
  serverURL: 'http://IP/parse',
  appName: "",
  publicServerURL: "http://IP/parse,
  emailAdapter: new SimpleMailgunAdapter({
    apiKey: '',
    domain: '',
    fromAddress: ''
  }),
  customPages: {
    invalidLink: 'http://yourpage/link_invalid.html',
    verifyEmailSuccess: 'http://yourpage/verify_email_success.html',
    choosePassword: 'http://yourpage/new_password.html',
    passwordResetSuccess: 'http://yourpage/sucess.html'
  }
});

@thamer898
Copy link
Author

Hello @felipemobile

Great work , can you explain about the html files and where i can get these files to redirect the user to it ?

Regards

@felipeandradebezerra
Copy link
Contributor

Hi @thamer898

You can get those HTML templates on the Parse dashboard

https://dashboard.parse.com/apps/{YOUR APP NAME}/settings/hosting

Customize User-Facing Pages

@thamer898
Copy link
Author

Hello @felipemobile

yes i found the page but the html which displayed is blank do you have any ready or i should do it by myself ?

Regards

@felipeandradebezerra
Copy link
Contributor

@thamer898

You can download all templates in HTML format from Parse Dashboard. There is a small link bellow each section. The only file that needs to be updated is the recovery password html.

@flovilmart
Copy link
Contributor

You actually don't need those pages, they should be served by default

@batkov
Copy link

batkov commented Mar 18, 2016

@felipemobile I believe that issue should be closed only after good tutorial would be written.

@felipeandradebezerra
Copy link
Contributor

@batkov It was closed by @gfosco since there are multiple threads about this issue.

@thamer898
Copy link
Author

Hello @felipemobile @batkov @gfosco

yes i agree with @batkov if this issue solved by good written tutorial i think all the problems will be solved .

Regards

@hramos hramos changed the title user reset password ? Add email verification docs Mar 18, 2016
@hramos
Copy link
Contributor

hramos commented Mar 18, 2016

This feature depends on the experimental MailAdapters feature. You can find additional in-progress documentation at #527 (comment).

If this feature moves out of the experimental phase, we can reopen this.

@hramos hramos closed this as completed Mar 18, 2016
@zeluspudding
Copy link

I've been scratching my head for a while as to how to get password resets working - see my documented frenzy at 554 if you wish. Anyhow, I finally figured out most of it yesterday and, having just now stumbled upon the holy grail that is this thread, bid you for an answer to the final piece. I've setup appName, emailAdapter (with sendgrid),and publicServerURL which gets me to Exhibit A below. I get an email (it has an imaginary image in it for some reason - how do I get rid of that?) that gives me a url. I click it and am taken to Exhibit B. I enter my new password and am taken to Exhibit C. I don't get a confirmation email and when I try to use the new password client side the login is rejected as if the password was never updated. The Beatles


passwordreset


@flovilmart
Copy link
Contributor

@zeluspudding as we said, this feature is experimental, undocumented and may have bugs.

@zeluspudding
Copy link

I'll tell the boss. Grazie.

@HemanParbhakar
Copy link

where can i get the html files so that i could configure them as wanted

@flovilmart
Copy link
Contributor

@Heman6886 you don't need the HTML pages, we provide them by default. If you want to override the pages, they are in the repository and you can pass them along with the option customPages: {}

@HemanParbhakar
Copy link

where are they present in the repository because i want to add custom pages for that i need the codes of the html so that i could add them in my custom pages

@flovilmart
Copy link
Contributor

Did you look? isn't public_html at the source of the repository explicit enough? Just in case, here is the link:

https://github.com/ParsePlatform/parse-server/tree/master/public_html

@HemanParbhakar
Copy link

thanxxxx

@HemanParbhakar
Copy link

but there are only three where can i get reset password

@flovilmart
Copy link
Contributor

In the views folder, please look around before asking.. and use stack overflow as these are not issues but questions.

@giefferre
Copy link

@flovilmart I've been trying with the customPages configuration object, but it does not work as expected, the Parse Server is still using the default template.

Is there something wrong with the configuration below?


var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost/parse',  // Don't forget to change to https if needed
  appName: process.env.APP_NAME || 'Parse Server',
  publicServerURL: process.env.PUBLIC_SERVER_URL || 'http://localhost/parse',
  verifyUserEmails: true,
  emailAdapter: {
    module: 'parse-server-simple-mailgun-adapter',
    options: {
      // The address that your emails come from
      fromAddress: process.env.MAIL_FROM_ADDRESS,
      // Your domain from mailgun.com
      domain: process.env.MAILGUN_DOMAIN,
      // Your API key from mailgun.com
      apiKey: process.env.MAILGUN_API_KEY,
    }
  },
  customPages: {
    invalidLink: 'http://URL/invalid_link.html',
    verifyEmailSuccess: 'http://URL/email_verification.html',
    choosePassword: 'http://URL/choose_password.html',
    passwordResetSuccess: 'http://URL/password_updated.html'
  }
});

@whitedove0125
Copy link

Hi, I dont receive the message on email.
Here is my code.

verifyUserEmails: true,
preventLoginWithUnverifiedEmail: false,
publicServerURL: 'http://192.168.1.8:1337/parse',
appName: 'Parse App',

emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: process.env.MAIL_FROM_ADDRESS || '[email protected]',
// Your domain from mailgun.com
domain: process.env.MAILGUN_DOMAIN || 'sandbox90d9a928de864aa0972b0cd0c35f4e9d.mailgun.org',
// Your API key from mailgun.com
apiKey: process.env.MAILGUN_API_KEY || 'key-d9ebc9c0ea3bd7e9e17be254fe7d7b89',
}
}

But I check on MongoDB database, there is email token.
What is issue?

@greggmojica
Copy link

How can I send a custom reset email?

@gateway
Copy link

gateway commented Oct 28, 2016

So I just went though this full process with parse-server-mailgun adaptor https://github.com/sebsylvester/parse-server-mailgun and was able to get all my email templates I needed themed and also using the custom pages to redirect to our apps website works well. I might do a how-to if I have time.

@kaanselhep
Copy link

@gateway Did you ever do a how-to for the parse-server-mailgun? I tried the SimpleMailgunAdapter as @felipemobile mentioned above but the server crashed with that config :(

@kaanselhep
Copy link

I managed to do this with: 'parse-server-simple-mailgun-adapter'
module instead.

@gateway
Copy link

gateway commented Dec 26, 2016

@kanersan what issues are you running into.. I have it all working however I never had time to write something up :/

@kaanselhep
Copy link

@gateway I fixed it using the parse-server-simple-mailgun-adapter instead of the SimpleMailgunAdapter or parse-server-mailgun-adaptor.

@scottmesser
Copy link

anyone know how to add bcc or cc to the emailAdapter options?

@FeleciaGenet
Copy link

Has anyone found a good tutorial or is anyone willing to help me out on this. I'm a fairly new programmer and can not figure this out for the life of me. I see mentions of the index.js file but I can't seem to find this file. Also, even if I did find the file I do not understand how me editing that file updates the database capabilities. And even if I learn how editing a file updates the database capabilities, I'm still lost as to the code I set when a user taps "Forgot Password". I've managed to set up my Parse server and get push notifications working months ago. This is the only thing I have not been able to accomplish. It's driving me crazy.

Seriously looking for a helping hand with this one. If anyone is available to help me out please email me [email protected]

wouldn't normally ask for all of this but it's my last resort as I have found myself Googling to the 25th result page looking for a solution to this issue.

@HemanParbhakar
Copy link

What issues are you facing can u elaborate

@FeleciaGenet
Copy link

FeleciaGenet commented Jul 7, 2017

yes of course i can.
I feel I am so close to figuring this out but I must be missing something.

Mailgun is installed on my heroku add ons and I have changed all of my DNS keys so my domain says "active" on Mailguns end.

i then downloaded " parse-server-simple-mailgun-adapter "

I located the root of the "parse-server" folder on my desktop and installed mailgun via "npm i parse-server-simple-mailgun-adapter " in Terminal. no errors or warnings in Terminal after installation.

On my desktop, I located my apps folder > found the parse-server-example-master > index.js

in index.js I have put the following code. perhaps I have not replaced a necessary key? For the sake of this discussion, everywhere where I have replaced the example keys with my own keys begins with "&" symbol.

After I replaced the following keys, I commit to my GItHub Desktop and Synced. The changes appear via my web github as expected. What am I doing wrong here?

Xcode console still prints "[Error]: An appName, publicServerURL, and emailAdapter are required for password reset functionality. (Code: 1, Version: 1.14.2)" when I tap the "forgot password" button i've created.

Felecia
(index.js code below)

// Example express application adding the parse-server module to expose Parse
// compatible API routes.
//

var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;

if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({

databaseURI: databaseUri || '&mongodb://[email protected]:00000/heroku_abcdefghijklmnopqrxzy',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || '&abcdefghijklmnopqrxzy',
masterKey: process.env.MASTER_KEY || '&abcdefghijklmnopqrxzy', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || '&http://abcdefghijklmnopqrxzy.herokuapp.com/parse', // Don't forget to change to https if needed
fileKey: process.env.PARSE_FILE_KEY || '&abcdefghijklmnopqrxzy',

serverURL: process.env.SERVER_URL || '&http://abcdefghijklmnopqrxzy.herokuapp.com/parse', // Don't forget to change to https if needed
// Enable email verification
verifyUserEmails: false,
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL

publicServerURL: '&http://abcdefghijklmnopqrxzy.herokuapp.com/parse',

// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'abcdefghijklmnopqrxzy',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: '&[email protected]',
// Your domain from mailgun.com
domain: '&mg.abcdefghijklmnopqrxzy.com',
// Your API key from mailgun.com
apiKey: '&key-abcdefghijklmnopqrxzy',
}
},

});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey

var app = express();

// Serve static assets from the /public folder
app.use('/public', express.static(path.join(__dirname, '/public')));

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);

// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a website. Please star the parse-server repo on GitHub!');
});

// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
res.sendFile(path.join(__dirname, '/public/test.html'));
});

var port = process.env.PORT || 1337;
var httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});

// This will enable the Live Query real-time server
ParseServer.createLiveQueryServer(httpServer);

What could i be doing wrong? THIS IS DRIVING ME NUTS.

@HemanParbhakar
Copy link

I Could Suggest You to Install Centos In Vmware and Run Parse Setup From new there and from where you could be able to capture the problem

@flovilmart
Copy link
Contributor

It seems that the configuration is correct, i’ll Have a look later today to see if anything’s Missing

@fprospato
Copy link

fprospato commented Jan 5, 2018

I have implemented the mailgun adapter with my Parse server to send email verifications and reset password emails. Everything is working perfectly fine, but I am concerned about the publicServerURL part because as of now I used my serverURL for this. So now when an email verification or a reset password email is sent, the link in the email body shows my serverURL, which is something I do not want.

So what can I put under publicServerURL?? Should I put the URL the projects website or is there another alternative? I have not found any information on this.

@flovilmart
Copy link
Contributor

the publicServerURL is a publicly accessible URL for the links. It can be what you want, preferably secure through HTTPS.

@fprospato
Copy link

I changed the publicServerURL to the project's website and now when I receive a link, my serverURL is not in the link and my project's website is. But when I press on the link, it brings me to an error page. How do I fix this?

@flovilmart
Copy link
Contributor

Depending of whether your serverURL is publicly accessible or not you could use it as the publicServerURL.

Let’s say you run Parse server on the port 3000 and it’s mounted on /parse.

A valid serverURL could be http://localhost:3000/Parse

Now, it’s deployed to be accessible over the Internet, let’s say on heroku and accessible on

my-project.heroku.com

You can set publicServerURL to

Https://my-project.heroku.com/Parse

Does it help?

@fprospato
Copy link

fprospato commented Jan 6, 2018

My serverURL is from AWS and I get it from the publicDNS column. I use this same URL to access my parseDashboard so I am not sure if I should use this URL as my publicServerURL. However, I have a website built through Wix.com for the project that is already published that I want to use for the publicServerURL, but I have no parse attachments to on that URL. How can I use this website?

I tried just using the URL, used the URL with '/parse' at the end, and used the URL with ':80/parse' at the end.

@flovilmart
Copy link
Contributor

You need to setup your DNS entries so a record points to your parse server.

@fprospato
Copy link

I have set up a domain that's link to my project's website (use 'project.com' to make this discussion easier) on mailgun and the domain verification and DNS are all checked off. Is this what you mean? Or is there something else that I'm missing to have project.com set as the publicServerURL?

@flovilmart
Copy link
Contributor

you need your parse server to be reachable on your project.com domain, with the full path to it so likely https://project.com/parse or something like that. Most likely on AWS Route53 your need to setup either a subdomain or your naked record to point to your Elastic Load Balancer that is serving your content.

@fprospato
Copy link

fprospato commented Jan 7, 2018

@flovilmart Sorry for the late response. I have set a subdomain on AWS Route 53 under hosted zones, but I do not know how to point this to my Parse Content. I have never used AWS Route 53 before and do not want to mess anything up so any help on this will be extremely appreciated.

@fprospato
Copy link

Any help on this will be greatly appreciated because I am lost on how to accomplish this.

@tiavina-mika
Copy link

the docs are not clear about it, so how to accomplish this?

@mtrezza
Copy link
Member

mtrezza commented Oct 11, 2021

@tiavina-mika for help with Parse Platform I suggest our community forum. If in the discussion there it turns out that the docs need to be improved, please feel free to open a new issue in the Parse Server repo (if it concerns the readme) or in the docs repo (if it concerns the Parse Server Guide).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests