Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:39:06+00:00 2026-06-15T11:39:06+00:00

I am following the example for RavenDB Oauth and it seems like the standard

  • 0

I am following the example for RavenDB Oauth and it seems like the standard practice here is to utilize a user name for generating the id key. This would require the user to input a username during registration and login.

I am looking to have to the authentication based on an email instead of a username, however I am running into a wall trying to figure out how to implement it properly.

I have implemented Oauth as follows

 using (IDocumentSession Session = DataDocumentStore.Instance.OpenSession())
            {
                Session.Store(new AuthenticationUser
                {
                    Name = Email,
                    Id = String.Format("Raven/Users/{0}", Email),
                    AllowedDatabases = new[] { "*" }
                }.SetPassword(Password));
                Session.SaveChanges();

                return Session.Load(String.Format("Raven/Users/{0}", Email));
            }

which would then allow us the authenticate the user using the following (given that email and password are the only data provided for login)

 using (IDocumentSession Session = DataDocumentStore.Instance.OpenSession())
            {
                return Session.Load(String.Format("Raven/Users/{0}", Email)).ValidatePassword(Password);
            }

The problem I am finding is that if I use the email as the document id key and the email changes, the document id and any documents referencing that id will all need to be changed.

However, if I use a RavenDB generated id (which would remain static even if the email changes) I cannot call Session.Load and will have to use Session.Query instead, which is not as optimized if I understand the documentation correctly.

So the question is, has anyone run into this before and (if so) can you provide a suggestion as to how I might accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:39:07+00:00Added an answer on June 15, 2026 at 11:39 am

    If the email can change, you can’t use it as the id.
    You would need to first do a query by the id then do the rest using the id you got from the query

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following the example on the RevenDB site , I came up with this: public
I have tree like following example, where every leaf is object. [1] |--[2] |
In following example I am attempting to change the charCode of the key pressed
Say I had a User class like this: public class User { public bool
The following example displays a modal dialog box when the user clicks the button.
The following example code will load a jqGrid (this code works) ... jQuery(document).ready(function ()
Following example from this link: http://developer.kde.org/documentation/books/kde-2.0-development/ch03lev1sec3.html #include <QObject> #include <QPushButton> #include <iostream> using namespace
Following this following example... public function insert($model,$brand,$price){ mysql_query(INSERT INTO autos (model, brand, price) VALUES
Using the following example i would like to use my Expression inside my Contains
Take the following example screen: This screen is displaying all current offers, these offers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.