Authorization in application

  • 1
  • Question
  • Updated 4 weeks ago
We are using sharefile api in web application.User will enter username(Email ID) and password.
Whether its possible to get subdomain name using Email ID?
If yes which api needs to be used.
Photo of rohini

rohini

  • 3 Posts
  • 1 Reply Like

Posted 1 month ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 731 Posts
  • 102 Reply Likes
Hi Rohini,

It is not possible to get a user's subdomain just based on the email address, the user will need to provide username and password and we will find all subdomains based on that combination.

Thank you,
Eli
Photo of rohini

rohini

  • 3 Posts
  • 1 Reply Like
Thanks for  your reply.
I need some more information regarding this.In our web app we are getting both username and password. To get sub-domain name what should be host name?

if __name__ == '__main__':
    hostname = "myaccount.sharefile.com"
    username = "my@user.name"
    password = "mypassword"
    client_id = 'myclientid'
    client_secret = 'myclientsecret'
     
    token = authenticate(hostname, client_id, client_secret, username, password)




Photo of Eliezer Encarnacion

Eliezer Encarnacion, Official Rep

  • 731 Posts
  • 102 Reply Likes
Rohini,

Your webapp should not be accepting username and password directly, that should be delegated to the ShareFile authentication screen at: https://secure.sharefile.com/oauth/authorize with information about your application (client id and request id, type of grant requested). ShareFile will take care of validating the password, displaying the subdomains for the user, and letting them select for which one they want to authenticate. This screen will redirect back to your application redirect url with an authorization code you can exchange for a token. See this page http://api.sharefile.com/rest/oauth2.aspx for a complete overview of that process.

If you are working on an application that is not web based and the user won't have a chance to enter their username and password, you must know the username, password, and subdomain beforehand.

Let me know if that helps.

Thanks!
Eli
Photo of rohini

rohini

  • 3 Posts
  • 1 Reply Like
Hi Eli,

Thanks for your reply.
 Its worked for me.

Thanks,
Rohini