@@ -173,8 +173,12 @@ public static class DropboxOAuth2Helper
173173 /// <param name="disableSignup">When <c>true</c> (default is <c>false</c>) users will not be able to sign up for a
174174 /// Dropbox account via the authorization page. Instead, the authorization page will show a link to the Dropbox
175175 /// iOS app in the App Store. This is only intended for use when necessary for compliance with App Store policies.</param>
176+ /// <param name="requireRole"If this parameter is specified, the user will be asked to authorize with a particular
177+ /// type of Dropbox account, either work for a team account or personal for a personal account. Your app should still
178+ /// verify the type of Dropbox account after authorization since the user could modify or remove the require_role
179+ /// parameter</param>
176180 /// <returns>The uri of a web page which must be displayed to the user in order to authorize the app.</returns>
177- public static Uri GetAuthorizeUri ( OAuthResponseType oauthResponseType , string clientId , string redirectUri = null , string state = null , bool forceReapprove = false , bool disableSignup = false )
181+ public static Uri GetAuthorizeUri ( OAuthResponseType oauthResponseType , string clientId , string redirectUri = null , string state = null , bool forceReapprove = false , bool disableSignup = false , string requireRole = null )
178182 {
179183 var uri = string . IsNullOrEmpty ( redirectUri ) ? null : new Uri ( redirectUri ) ;
180184
@@ -201,8 +205,12 @@ public static Uri GetAuthorizeUri(OAuthResponseType oauthResponseType, string cl
201205 /// <param name="disableSignup">When <c>true</c> (default is <c>false</c>) users will not be able to sign up for a
202206 /// Dropbox account via the authorization page. Instead, the authorization page will show a link to the Dropbox
203207 /// iOS app in the App Store. This is only intended for use when necessary for compliance with App Store policies.</param>
208+ /// <param name="requireRole"If this parameter is specified, the user will be asked to authorize with a particular
209+ /// type of Dropbox account, either work for a team account or personal for a personal account. Your app should still
210+ /// verify the type of Dropbox account after authorization since the user could modify or remove the require_role
211+ /// parameter</param>
204212 /// <returns>The uri of a web page which must be displayed to the user in order to authorize the app.</returns>
205- public static Uri GetAuthorizeUri ( OAuthResponseType oauthResponseType , string clientId , Uri redirectUri = null , string state = null , bool forceReapprove = false , bool disableSignup = false )
213+ public static Uri GetAuthorizeUri ( OAuthResponseType oauthResponseType , string clientId , Uri redirectUri = null , string state = null , bool forceReapprove = false , bool disableSignup = false , string requireRole = null )
206214 {
207215 if ( string . IsNullOrWhiteSpace ( clientId ) )
208216 {
@@ -251,6 +259,11 @@ public static Uri GetAuthorizeUri(OAuthResponseType oauthResponseType, string cl
251259 queryBuilder . Append ( "&disable_signup=true" ) ;
252260 }
253261
262+ if ( ! string . IsNullOrWhiteSpace ( requireRole ) )
263+ {
264+ queryBuilder . Append ( "require_role=" ) . Append ( requireRole ) ;
265+ }
266+
254267 var uriBuilder = new UriBuilder ( "https://www.dropbox.com/oauth2/authorize" )
255268 {
256269 Query = queryBuilder . ToString ( )
0 commit comments