From 9036af3a6300cd941d4c2868f962f39257ff785e Mon Sep 17 00:00:00 2001 From: John Yaist Date: Mon, 5 Aug 2024 13:50:51 -0700 Subject: [PATCH] added code to illustrate retrieving a token --- ...ith-different-authentication-schemes.ipynb | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/guide/03-the-gis/working-with-different-authentication-schemes.ipynb b/guide/03-the-gis/working-with-different-authentication-schemes.ipynb index df7426ae9c..05dff57aa3 100644 --- a/guide/03-the-gis/working-with-different-authentication-schemes.ipynb +++ b/guide/03-the-gis/working-with-different-authentication-schemes.ipynb @@ -108,6 +108,38 @@ "print(\"Logged in as anonymous user to \" + gis.properties.portalName)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Authenticated Connections" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieving the token\n", + "\n", + "Most Web GIS users will connect using a method to authenticate and authorize use of the Web GIS. Once authenticated, it can object times be necessary or desirable to retrieve the token from the authenticated GIS. The code below documents how to get the token object:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "token = gis.session.auth.token" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> **note:** See the [Module Contents](/python/api-reference/arcgis.auth.html#module-arcgis.auth) documentation for type of authentication object returned depending upon which authentication schema is being used." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -609,7 +641,7 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -623,7 +655,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.11" + "version": "3.11.0" }, "toc": { "base_numbering": 1, @@ -640,5 +672,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 }