Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

added redirectUri parameter to GetAuthorizationUrl #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TrelloNet/ITrello.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ public interface ITrello
void Authorize(string token);
void Deauthorize();
Uri GetAuthorizationUrl(string applicationName, Scope scope, Expiration expiration = Expiration.ThirtyDays);
Uri GetAuthorizationUrl(string applicationName, Scope scope, Uri redirectUri, Expiration expiration = Expiration.ThirtyDays);
}
}
8 changes: 8 additions & 0 deletions TrelloNet/Internal/TrelloRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public Uri GetAuthorizationUrl(string applicationName, Scope scope, Expiration e
BaseUrl, _applicationKey, applicationName, scope.ToScopeString(), expiration.ToExpirationString()));
}

public Uri GetAuthorizationUrl(string applicationName, Scope scope, Expiration expiration, Uri redirectUri)
{
Guard.NotNullOrEmpty(applicationName, "applicationName");

return new Uri(string.Format("{0}/authorize?key={1}&name={2}&scope={3}&expiration={4}&callback_method=fragment&return_url={5}",
BaseUrl, _applicationKey, applicationName, scope.ToScopeString(), expiration.ToExpirationString(), Uri.EscapeUriString(redirectUri.ToString())));
}

public void Request(IRestRequest request)
{
var response = Execute(request);
Expand Down
5 changes: 5 additions & 0 deletions TrelloNet/Trello.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ public Uri GetAuthorizationUrl(string applicationName, Scope scope, Expiration e
{
return _restClient.GetAuthorizationUrl(applicationName, scope, expiration);
}

public Uri GetAuthorizationUrl(string applicationName, Scope scope, Uri redirectUri, Expiration expiration = Expiration.ThirtyDays)
{
return _restClient.GetAuthorizationUrl(applicationName, scope, expiration, redirectUri);
}
}
}