{"id":4561,"date":"2025-06-28T14:53:11","date_gmt":"2025-06-28T14:53:11","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4561"},"modified":"2025-06-28T14:53:13","modified_gmt":"2025-06-28T14:53:13","slug":"aws-workstation-sso-login-and-no-browser","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4561","title":{"rendered":"AWS Workstation, SSO Login and No Browser"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here&#8217;s a quick example configuration. I&#8217;m assuming you already have the AWS CLI packages installed, but if you need to use SSO to login to your AWS Organisation\/Account, you can use the following example.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AWS CLI Configuration File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The AWS configuration file that should be located in: <strong>~\/.aws\/config<\/strong>, with the contents such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;sso-session mysso]\nsso_start_url = https:\/\/d-12345678.awsapps.com\/start#\nsso_region = eu-west-2\nsso_role_name = AWSAdministratorAccess\nsso_registration_scopes = sso:account:access\n \n&#91;profile myawsaccount1]\nsso_session = mysso\nsso_account_id = 12345678901\nsso_role_name = AWSAdministratorAccess\nregion = eu-west-2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So let&#8217;s examine this file, we have the &#8220;sso-session&#8221; this is the SSO session for your AWS Organisation, your SSO Start URL will differ, as will your region and access required. So adjust accordingly. You then have a &#8220;profile&#8221; for each of your AWS Accounts, in my example I just have one, but you may want one for each of your AWS accounts that you want to login to. Obviously each must have a unique profile name, normally just using the AWS account name is sensible, and the Account ID.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now you&#8217;re ready to login.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export AWS_PROFILE=myawsaccount1\naws sso login<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll then be prompted via your web browser to authenticate via SSO (and MFA assuming you have it enabled), you&#8217;re command prompt should then show you have authenticated successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But what if you are on a workstation with no web browser? Well, see the next section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AWS SSO with No Browser<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s really simple, you just run the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export AWS_PROFILE=myawsaccount1\naws sso login --no-browser --use-device-code<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now take the URL shown copy and paste into your web browser window (which is already logged onto AWS) on a machine where you do have a web browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: you must not cancel\/CTRL-C the command in your Workstation or it won&#8217;t work. Once you have authenticated via your web browser the CLI will then automatically log you in, once approved within your web browser.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick example configuration. I&#8217;m assuming you already have the AWS CLI packages installed, but if you need to use SSO to login to your AWS Organisation\/Account, you can use the following example. AWS CLI Configuration File The AWS configuration file that should be located in: ~\/.aws\/config, with the contents such as: So let&#8217;s &#8230; <a title=\"AWS Workstation, SSO Login and No Browser\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4561\" aria-label=\"Read more about AWS Workstation, SSO Login and No Browser\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-4561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4561"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4561\/revisions"}],"predecessor-version":[{"id":4562,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4561\/revisions\/4562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4373"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}