You must be running on the latest office 365 platform so therefore you wont need the deviceid & password.
If you download the training kit & look at the sample there it should point you in the right direction
www.microsoft.com/.../details.aspx
Also just make sure you download the latest CRM SDK as you need to make sure you have the latest dlls to make the connection.