var AuthProvider = /** @class */ (function () {
    function AuthProvider(providerId, endpoint, scopes) {
        this.providerId = providerId;
        this.endpoint = endpoint;
        this.scopes = scopes;
    }
    AuthProvider.prototype.addScope = function (scope) {
        this.scopes = this.scopes + ' ' + scope;
    };
    AuthProvider.prototype.setCustomParameters = function (customOAuthParameters) {
        this.customParameters = customOAuthParameters;
    };
    AuthProvider.prototype.url = function (clientId, redirectUri) {
        var params = '';
        if (!!this.customParameters) {
            for (var _i = 0, _a = Object.keys(this.customParameters); _i < _a.length; _i++) {
                var key = _a[_i];
                params += '&' + key + '=' + this.customParameters[key];
            }
        }
        return this.endpoint + '?' +
            "response_type=token&" +
            ("client_id=" + clientId + "&") +
            ("redirect_uri=" + redirectUri + "&") +
            ("scope=" + this.scopes) +
            params;
    };
    return AuthProvider;
}());
export { AuthProvider };
