How to get the email address for the current logged in user in EWS? - exchangewebservices

What is the correct way of getting a user's email address using EWS SOAP API's if I have the credentials (username & password) and the server address.

What you need is as follow:
Create a AuthenticationContext
Setup a ClientCredential
Use AuthenticationContext to acquire a token
You will have to pass a callback which if the authentication is fine, you will receive AuthenticationResult in onSuccess of AuthenticationCallback
You can get the information from AuthenticationResult.UserInfo.DisplayableId

Related

Yii2 Auth Client Api

i have plan about write Api Module for login by api. Detail, that another device can login with social account(Facebook, Google, etc..). So i not exact scenario for todo.
First i have scenario:
Client Send token to server
Server receive token and clients name(facebook, google..) and receive user info.
Server store data and response to client
Client receive data and login
So, please share me detail or show me some document for more info.

How to get Registration data to used in Login Request

I make Test Plan in Jmeter consist of Registration and Login.
First, I run Registration Request and after that I would like to get the results (email & password) that have been verified to used in Login.
I make user defined manager but it doesn't work.
On the picture you have attached the regular expression extractor to the login sampler. If your registration request is answering with the response containing email & password add 2 regular expression extractors there (on the registration sampler) and take the email with the first + the password with the second extractor + make sure you fill in the Server Name or IP field in the requests (don't see them on the picture)
It looks like you missing one request, it should be like:
Obtaining the Request Token and Token Secret using the Consumer Key and Consumer Secret
Obtaining the Authorization Token using the Request Token and Secret
Exchanging the Authorization Token to the Access Token - which can be used to access protected resources.
And on each step you need to perform correlation, like extract dynamic parameter from previous response and pass it with the next request, I don't see the relevant post-processors in your test plan so I would suggest using JSON Path Extractor for this.
See How to Run Performance Tests on OAuth Secured Apps with JMeter article for more details on bypassing OAuth login challenge in your JMeter test.

Get user's email from twitter login in yii2

I could successfully get email of the user while logging in with google, facebook, and vkontakte.
Twitter by default doesno allow getting an email of the user.
After a request I got this permission and in my Twitter apps I have
Request email addresses from users as checked.
But in the result array I get a lot of data with twits, username, timezone, etc. except the email.
What can be the problem?
Has this user been authenticated in your system previously? The official docs state this:
Note
Your app will need to regenerate the user access tokens for
previously authenticated users to access their email address.
So perhaps that's what causing the problem. Otherwise you should be getting email addresses if include_email is set to true.
It was not yet implemented in Yii2. It is going to be probably added very soon. Now it is not possible to send twitter params with default configuration
It is
return $this->api('account/verify_credentials.json', 'GET');inside the AuthClient,
but it must be return $this->api('account/verify_credentials.json', 'GET', ['include_email' => 'true']);

Getting Encrypted CAS User through serviceValidate

I am using oauth2.0 to get service token from CAS server. When trying to validate token using
/cas/serviceValidate url getting response
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
<cas:authenticationSuccess>
<cas:user>JJuH5FMVz6Lsq+4xwIpe39iCZx0=</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>
where user is in encrypted format. I know that may user/pass is admin/admin. How can we identify user or encryption technique used.
Thanks,

Set IMAP hostname while sending email using JavamailAPI

I have a IMAP server host name : xyz.com. And my SMTP host name is : comcast.net.
Now when I send emails via Outlook it automatically shows my ID [sender ID] as : myusername#xyz.com and not myusername#comcast.net.
I would like to achieve the same using JavaMail API.
When I use JavaMail API, it shows the sender as myusername#comcast.net. I understand this is the way it works. IMAP for receiving emails and SMTP for sending emails.
However, I would like to develop the behavior similar to that of Outlook where it sets IMAPs server hostname, instead of the SMTP's server hostname, in the sender ID.
Thanks & Regards,
Ravikiran Mane.
I think you're talking about the difference between what you put in the From header of the message (using the setFrom method), and what user name you use when you login to your mail server to send the message (using the connect method). Normally they would be the same. Your mail server may or may not allow you to set a different address in the From header. Some mail servers will require you to verify that the alternate From address is actually your address before they will let you send a message with that in the From header.