Skip to content

Commit f0b9f9e

Browse files
author
Eric Koleda
committed
1.33.0
1 parent 3fa0aa3 commit f0b9f9e

File tree

7 files changed

+176
-6
lines changed

7 files changed

+176
-6
lines changed

dist/OAuth2.gs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,17 @@ Service_.prototype.setIssuer = function(issuer) {
350350
return this;
351351
};
352352

353+
/**
354+
* Sets additional JWT claims to use for Service Account authorization.
355+
* @param {Object.<string,string>} additionalClaims The additional claims, as
356+
* key-value pairs.
357+
* @return {Service_} This service, for chaining.
358+
*/
359+
Service_.prototype.setAdditionalClaims = function(additionalClaims) {
360+
this.additionalClaims_ = additionalClaims;
361+
return this;
362+
};
363+
353364
/**
354365
* Sets the subject (sub) value to use for Service Account authorization.
355366
* @param {string} subject This subject value
@@ -781,6 +792,12 @@ Service_.prototype.createJwt_ = function() {
781792
if (this.params_.scope) {
782793
claimSet.scope = this.params_.scope;
783794
}
795+
if (this.additionalClaims_) {
796+
var additionalClaims = this.additionalClaims_;
797+
Object.keys(additionalClaims).forEach(function(key) {
798+
claimSet[key] = additionalClaims[key];
799+
});
800+
}
784801
var toSign = Utilities.base64EncodeWebSafe(JSON.stringify(header)) + '.' +
785802
Utilities.base64EncodeWebSafe(JSON.stringify(claimSet));
786803
var signatureBytes =

docs/Service_.html

Lines changed: 154 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,159 @@ <h4 class="name" id="reset"><span class="type-signature"></span>reset<span class
16291629

16301630

16311631

1632+
1633+
1634+
1635+
1636+
<h4 class="name" id="setAdditionalClaims"><span class="type-signature"></span>setAdditionalClaims<span class="signature">(additionalClaims)</span><span class="type-signature"> &rarr; {<a href="Service_.html">Service_</a>}</span></h4>
1637+
1638+
1639+
1640+
1641+
1642+
1643+
<div class="description">
1644+
Sets additional JWT claims to use for Service Account authorization.
1645+
</div>
1646+
1647+
1648+
1649+
1650+
1651+
1652+
1653+
1654+
1655+
<h5>Parameters:</h5>
1656+
1657+
1658+
<table class="params">
1659+
<thead>
1660+
<tr>
1661+
1662+
<th>Name</th>
1663+
1664+
1665+
<th>Type</th>
1666+
1667+
1668+
1669+
1670+
1671+
<th class="last">Description</th>
1672+
</tr>
1673+
</thead>
1674+
1675+
<tbody>
1676+
1677+
1678+
<tr>
1679+
1680+
<td class="name"><code>additionalClaims</code></td>
1681+
1682+
1683+
<td class="type">
1684+
1685+
1686+
<span class="param-type">Object.&lt;string, string></span>
1687+
1688+
1689+
1690+
</td>
1691+
1692+
1693+
1694+
1695+
1696+
<td class="description last">The additional claims, as
1697+
key-value pairs.</td>
1698+
</tr>
1699+
1700+
1701+
</tbody>
1702+
</table>
1703+
1704+
1705+
1706+
1707+
1708+
1709+
<dl class="details">
1710+
1711+
1712+
1713+
1714+
1715+
1716+
1717+
1718+
1719+
1720+
1721+
1722+
1723+
1724+
1725+
1726+
1727+
1728+
1729+
1730+
1731+
1732+
1733+
1734+
1735+
1736+
1737+
1738+
1739+
1740+
1741+
1742+
</dl>
1743+
1744+
1745+
1746+
1747+
1748+
1749+
1750+
1751+
1752+
1753+
1754+
1755+
1756+
<h5>Returns:</h5>
1757+
1758+
1759+
<div class="param-desc">
1760+
This service, for chaining.
1761+
</div>
1762+
1763+
1764+
1765+
<dl>
1766+
<dt>
1767+
Type
1768+
</dt>
1769+
<dd>
1770+
1771+
<span class="param-type"><a href="Service_.html">Service_</a></span>
1772+
1773+
1774+
</dd>
1775+
</dl>
1776+
1777+
1778+
1779+
1780+
1781+
1782+
1783+
1784+
16321785

16331786

16341787

@@ -4822,7 +4975,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
48224975
<br class="clear">
48234976

48244977
<footer>
4825-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
4978+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
48264979
</footer>
48274980

48284981
<script> prettyPrint(); </script>

docs/Storage_.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
763763
<br class="clear">
764764

765765
<footer>
766-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
766+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
767767
</footer>
768768

769769
<script> prettyPrint(); </script>

docs/global.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
13611361
<br class="clear">
13621362

13631363
<footer>
1364-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
1364+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
13651365
</footer>
13661366

13671367
<script> prettyPrint(); </script>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Service_.
689689
<br class="clear">
690690

691691
<footer>
692-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 08 2019 11:46:13 GMT-0500 (EST)
692+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 15 2019 13:06:16 GMT-0400 (EDT)
693693
</footer>
694694

695695
<script> prettyPrint(); </script>

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apps-script-oauth2",
3-
"version": "1.32.0",
3+
"version": "1.33.0",
44
"description": "OAuth2 for Apps Script is a library for Google Apps Script that provides the ability to create and authorize OAuth2 tokens as well as refresh them when they expire.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)