How do we retrieve user ID and iam token with below curl request?












-1














As a federated user, it must use an API key or one-time passcode to authenticate. I have tried to execute that the below curl request:-



Example :-



Input :-



curl -s -u 'bx:bx' -k -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d "grant_type=password&response_type=cloud_iam,ims_portal&username=${1}&password=${2}&ims_account=${3}" https://iam.ng.bluemix.net/oidc/token


Output :-



"errorMessage":"You cannot authenticate with user name and password, as you are a federated user","errorDetails":"Your user id '<<><><>>' is federated and must use an API key or one-time passcode to authenticate"


But how we authenticate the user to generate the iam_token and iam_user_id?



Reference :-
https://softlayer.github.io/rest/IBMidtoSLKey/










share|improve this question





























    -1














    As a federated user, it must use an API key or one-time passcode to authenticate. I have tried to execute that the below curl request:-



    Example :-



    Input :-



    curl -s -u 'bx:bx' -k -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d "grant_type=password&response_type=cloud_iam,ims_portal&username=${1}&password=${2}&ims_account=${3}" https://iam.ng.bluemix.net/oidc/token


    Output :-



    "errorMessage":"You cannot authenticate with user name and password, as you are a federated user","errorDetails":"Your user id '<<><><>>' is federated and must use an API key or one-time passcode to authenticate"


    But how we authenticate the user to generate the iam_token and iam_user_id?



    Reference :-
    https://softlayer.github.io/rest/IBMidtoSLKey/










    share|improve this question



























      -1












      -1








      -1


      0





      As a federated user, it must use an API key or one-time passcode to authenticate. I have tried to execute that the below curl request:-



      Example :-



      Input :-



      curl -s -u 'bx:bx' -k -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d "grant_type=password&response_type=cloud_iam,ims_portal&username=${1}&password=${2}&ims_account=${3}" https://iam.ng.bluemix.net/oidc/token


      Output :-



      "errorMessage":"You cannot authenticate with user name and password, as you are a federated user","errorDetails":"Your user id '<<><><>>' is federated and must use an API key or one-time passcode to authenticate"


      But how we authenticate the user to generate the iam_token and iam_user_id?



      Reference :-
      https://softlayer.github.io/rest/IBMidtoSLKey/










      share|improve this question















      As a federated user, it must use an API key or one-time passcode to authenticate. I have tried to execute that the below curl request:-



      Example :-



      Input :-



      curl -s -u 'bx:bx' -k -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d "grant_type=password&response_type=cloud_iam,ims_portal&username=${1}&password=${2}&ims_account=${3}" https://iam.ng.bluemix.net/oidc/token


      Output :-



      "errorMessage":"You cannot authenticate with user name and password, as you are a federated user","errorDetails":"Your user id '<<><><>>' is federated and must use an API key or one-time passcode to authenticate"


      But how we authenticate the user to generate the iam_token and iam_user_id?



      Reference :-
      https://softlayer.github.io/rest/IBMidtoSLKey/







      ibm-cloud ibm-cloud-infrastructure






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 8:13









      Vidyasagar Machupalli

      836615




      836615










      asked Nov 19 '18 at 15:34









      DEngineer

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          1














          The code snippet you reference from the SoftLayer guide has the result of setting the SoftLayer Username and API key:



          echo "SL_USERNAME: $SL_USERNAME"
          echo "SL_API_KEY: $SL_API_KEY"


          This is a roundabout way to find the same information that is listed as API Username and Authentication Key seen in your User Profile. If you do not see an API username and Authentication Key, you can create one on the Actions menu next to your name in the User List.



          You can then execute Infrastructure APIs, which I expect is the ultimate goal.



          export IAAS_USERNAME=<API Username>
          export IAAS_KEY=<Authentication Key>
          curl -u $IAAS_USERNAME:$IAAS_KEY https://api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems


          It's unclear if the discussion around IAM tokens is necessary. Please provide more guidance on what you're trying to achieve if the above suggestion is insufficient.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377955%2fhow-do-we-retrieve-user-id-and-iam-token-with-below-curl-request%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            The code snippet you reference from the SoftLayer guide has the result of setting the SoftLayer Username and API key:



            echo "SL_USERNAME: $SL_USERNAME"
            echo "SL_API_KEY: $SL_API_KEY"


            This is a roundabout way to find the same information that is listed as API Username and Authentication Key seen in your User Profile. If you do not see an API username and Authentication Key, you can create one on the Actions menu next to your name in the User List.



            You can then execute Infrastructure APIs, which I expect is the ultimate goal.



            export IAAS_USERNAME=<API Username>
            export IAAS_KEY=<Authentication Key>
            curl -u $IAAS_USERNAME:$IAAS_KEY https://api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems


            It's unclear if the discussion around IAM tokens is necessary. Please provide more guidance on what you're trying to achieve if the above suggestion is insufficient.






            share|improve this answer


























              1














              The code snippet you reference from the SoftLayer guide has the result of setting the SoftLayer Username and API key:



              echo "SL_USERNAME: $SL_USERNAME"
              echo "SL_API_KEY: $SL_API_KEY"


              This is a roundabout way to find the same information that is listed as API Username and Authentication Key seen in your User Profile. If you do not see an API username and Authentication Key, you can create one on the Actions menu next to your name in the User List.



              You can then execute Infrastructure APIs, which I expect is the ultimate goal.



              export IAAS_USERNAME=<API Username>
              export IAAS_KEY=<Authentication Key>
              curl -u $IAAS_USERNAME:$IAAS_KEY https://api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems


              It's unclear if the discussion around IAM tokens is necessary. Please provide more guidance on what you're trying to achieve if the above suggestion is insufficient.






              share|improve this answer
























                1












                1








                1






                The code snippet you reference from the SoftLayer guide has the result of setting the SoftLayer Username and API key:



                echo "SL_USERNAME: $SL_USERNAME"
                echo "SL_API_KEY: $SL_API_KEY"


                This is a roundabout way to find the same information that is listed as API Username and Authentication Key seen in your User Profile. If you do not see an API username and Authentication Key, you can create one on the Actions menu next to your name in the User List.



                You can then execute Infrastructure APIs, which I expect is the ultimate goal.



                export IAAS_USERNAME=<API Username>
                export IAAS_KEY=<Authentication Key>
                curl -u $IAAS_USERNAME:$IAAS_KEY https://api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems


                It's unclear if the discussion around IAM tokens is necessary. Please provide more guidance on what you're trying to achieve if the above suggestion is insufficient.






                share|improve this answer












                The code snippet you reference from the SoftLayer guide has the result of setting the SoftLayer Username and API key:



                echo "SL_USERNAME: $SL_USERNAME"
                echo "SL_API_KEY: $SL_API_KEY"


                This is a roundabout way to find the same information that is listed as API Username and Authentication Key seen in your User Profile. If you do not see an API username and Authentication Key, you can create one on the Actions menu next to your name in the User List.



                You can then execute Infrastructure APIs, which I expect is the ultimate goal.



                export IAAS_USERNAME=<API Username>
                export IAAS_KEY=<Authentication Key>
                curl -u $IAAS_USERNAME:$IAAS_KEY https://api.softlayer.com/rest/v3/SoftLayer_Account/getAllBillingItems


                It's unclear if the discussion around IAM tokens is necessary. Please provide more guidance on what you're trying to achieve if the above suggestion is insufficient.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 19 '18 at 19:51









                Van Staub

                713




                713






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377955%2fhow-do-we-retrieve-user-id-and-iam-token-with-below-curl-request%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$