How to use user id instead of username when spring websocket stomp sends to a specified user? - spring-websocket

I have a function module that sends notifications to users and there are two types of users,
1.one is an ordinary account, each account can only be online once at the same time
2.the other is an ip user, when an ip user logs in, it determines whether the user's ip is Within the scope of the ip user table, and the username is the real-time ip of the obtained user as the username.
3.When I use simpMessagingTemplate.convertAndSendToUser(String user, String destination, Object payload)) to send a notification to a specified user, for ordinary users, I can directly pass the username, and for ip users, only id without username, For the username of the ip user, the real-time ip obtained when the ip user logs in is used as the username
4.The problem now is that when I want to send a notification to the ip user, I only have the id of the ip user and not the user name of the ip user. I want to call simpMessagingTemplate.convertAndSendToUser(String user, String destination, Object payload)) to send to the specified user and replace the user name with id. Is there any way to achieve this?

1.I solved the problem using this method.
2.customize mine Principal
setHandshakeHandler in StompEndpointRegistry

Related

Change the Sender in Outlook using Redemption, but not with an account in the profile

I'm attempting to create Outlook emails that should be sent "from" someone other than the person actually sending the email. The idea is to prefill the email, display it in Outlook, allowing the end user to modify before sending. As a part of that process, I would like to use a different email address, which is a true email address, but is not an account in the end user's profile.
If this were SMTP, I could use the Net.Mail classes, which will accept any smtp address as the sender. Like this:
string from = "mytest#myorg.com";
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(from, to);
My question then, is it possible to do this using Redemption? All the examples that I've been able to find talk about either accessing the "Sender" property, or the "SendUsingAccount" property. From what I can tell, these both require an Account in the user profile.
If you are sending using Exchange (as well as most SMTP servers), it will not let you spoof the sender. The user must actually have the right to send as that user.

Firebase authentication Login multiple provider with same email

I want users can login using many different provider Like Google+, Facebook and Email/Password but they will get same result if they use only same email address. Prevent multiple accounts and data managed by same UID
That is actually a feature of Firebase Authentication. If you configure it to allow only one account per email address (which is the default I think), it will only allow a single account per email address. When a user then logs in with a different provider, you can link the credentials for both under a single account/UID.

Is it possible for users to contact each other without knowing their email addresses via Mandrill?

My website allow User A send email to User B through a form. Currently if User B want to reply, he need to login to my website and use the same form.
User A dont know the User B's email address and vice versa.
I would like to allow User B reply to User A directly using his mail client without need to login to my website (while still keep both email addresses confidentially). So User A send a message to User B using the form. User B can reply to user A using his email client, and user B can reply to user A using email client too without reveal their email address.
I was told this is possible with Mandrill Webhook. Is that correct? Can anybody please show me how?
Thanks a lot.
I think what you need to do is inbound email processing.
First, create an inbound domain in your Mandrill dashboard.
Set up routes / webhooks in your dashboard (for example, sending an email to pm#example.com will send a POST to http://example.com/email-processing/pm).
In your application, process the received message and decide if you have to send it to one of your user, and more important, which user.
To do so, you can add a unique ID inside your emails. So you just have to read this ID when you receive an email, and you know who is the sender and who should be the receiver. Of course, you should also check the sender's email address.
More informations about the first two steps: http://help.mandrill.com/entries/21699367-Inbound-Email-Processing-Overview

Can email address not verified in oauth2?

I know not all providers give out user email address, but assuming if they use oauth2 and the email field is not empty, can I say that email address must be verified ?
Using plain OAuth 2.0 (plus provider specific extensions that would be required for this scenario) this is not possible in a generic way. Using OpenID Connect, which is a standardized extension of OAuth 2.0 that provides login semantics this is possible through the standardized email_verified claim that is provides as part of the so-called ID token, and something can be requested explicitly in the authentication request.
Ofcourse it's possible. First you would have an intermediate form that would get redirected to from any provider, and fills in the fields, including email if available, if not available, then it will be blank for the user to fill it in and submit the form. You have to structure your application so that if a email address field is available and not empty and a valid email populate it in the field and allow the user to submit the form, then you would send the email verification email and perform any other step that you want when a user creates an account.
I would separate it out into events, and fire events when a user account is created. Then attach some listeners to listen to user account created event.
You can then create new event listeners and attach them to the event as needed.
Some good videos about Commands and Domain Events are available on Laracasts https://laracasts.com/series/commands-and-domain-events

Retrieving employee email addresses via Quickbooks API

I'm trying to create a list of employees and their email addresses using the Quickbooks API. I'm using the following API call:
https://qb.sbfinance.intuit.com/v3/company/123/query?query=SELECT * FROM Employee
This returns a lot of great information, but not the email address. According to the docs, it should be returned as PrimaryEmailAddr. Any ideas?
UPDATE
It turns out that if you create a user in QuickBooks and attach that user to an existing employee, the email address used by the user does not automatically propagate to the employee record. So, my new question is this: is there any way to get the email addresses of users that are associated with a company (regardless of whether or not they are employees)?
What you are saying is if you invite some users(who are employees) to your company file using some email and that email address should come up when you query for employee entity. This use case is not supported. You need to explicitly mention the email address while creating an employee record, then only it will be retrieved on Read call.
There is no API to find the users associated with one company file.

Resources