Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Guide to secure your SmartAPI Account with two factor authentication

    General Discussion
    0
    104
    1955
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aj_Brk @gautamnaik1994 last edited by

      @gautamnaik1994 I have provided a sample code below. You can give it a shot. Worked for me .

      N 1 Reply Last reply Reply Quote 0
      • A
        anil_patel @aj_Brk last edited by anil_patel

        @admin @aj_Brk can you tell me how to Create a Secret Key Based on the User ID & Pass of the User?

        A 1 Reply Last reply Reply Quote 0
        • A
          aj_Brk @anil_patel last edited by

          @anil_patel I generated it here - http://smartapi.angelbroking.com/enable-totp . It is printed below QR code

          A P 2 Replies Last reply Reply Quote 0
          • A
            anil_patel @aj_Brk last edited by

            @admin @aj_Brk Thank you but I want the user to Login without Generating TOTP. so users only add their User ID & Pass and based on that Python will generate the Secret Key to generate TOTP.

            A 1 Reply Last reply Reply Quote 0
            • A
              admin @ivar last edited by admin

              @ivar
              You are not required to pass the TOTP with every order. It needs to be passed only with LoginbyPassword API call to generate the session and fetch the jwtToken, refreshToken and feedToken. These tokens are valid till 5 am of the subsequent day.

              A I 2 Replies Last reply Reply Quote 0
              • R
                ravitandur last edited by

                @admin said in Guide to secure your SmartAPI Account with two factor authentication:

                https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword
                Is this API is working?
                When I am trying to use POST method with the above URL and sending the data, getting 415 error.

                punit 1 Reply Last reply Reply Quote 0
                • N
                  nitish.bane @aj_Brk last edited by nitish.bane

                  @aj_Brk How can I automate this through node js. How can i generate the secret required to generate totp

                  1 Reply Last reply Reply Quote 0
                  • B
                    babitakundu @aj_Brk last edited by

                    @aj_Brk obj.generateSession() is throwing an error.

                    TypeError: generateSession() takes 3 positional arguments but 4 were given.

                    Are you getting the same?

                    A M 2 Replies Last reply Reply Quote 0
                    • I
                      imakr @labeebta last edited by

                      @labeebta How to do it in python automatically? can you please brief , sorry im new to python

                      A 1 Reply Last reply Reply Quote 0
                      • P
                        priya @aj_Brk last edited by

                        @aj_Brk after generating this at code scan it with Google authenticator app. Then in authenticator app there will be OTP changing every minutes. While login put this current OTP . And it's done.

                        D 1 Reply Last reply Reply Quote 0
                        • A
                          aj_Brk @babitakundu last edited by

                          @babitakundu are you providing 4 fields. It only needs 3. I didnt face this exception.

                          B 1 Reply Last reply Reply Quote 0
                          • A
                            aj_Brk @imakr last edited by

                            @imakr shared the code in the forum. Uses pyotp library

                            1 Reply Last reply Reply Quote 0
                            • A
                              aj_Brk @anil_patel last edited by

                              @anil_patel i don't think that is possible as the secret is generated by angel servers, logic of which is not shared. We can't do this without secret shared by them.

                              punit 1 Reply Last reply Reply Quote 0
                              • B
                                babitakundu @aj_Brk last edited by

                                @aj_Brk i passed obj.generateSession(usrname,pwd,totp)

                                1 Reply Last reply Reply Quote 0
                                • K
                                  KalpeshRajai last edited by

                                  I am using the .NET SDK and Now I am getting the Invalid Token error!!

                                  What we can do as I am using the .NET SDK?

                                  https://github.com/angel-one/smartapi-dotnet

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    mudit236 @babitakundu last edited by

                                    @babitakundu @admin facing the same error, has the smartapi-python library been updated for totp changes?

                                    punit A 3 Replies Last reply Reply Quote 0
                                    • punit
                                      punit @mudit236 last edited by

                                      @mudit236 Yes, the files are updated in github, need to checkout the changes are make them manually.
                                      45e1dad5-010e-4264-96af-68711607d1fc-image.png

                                      M B A 3 Replies Last reply Reply Quote 0
                                      • M
                                        mudit236 @punit last edited by

                                        @Ashok Okay thanks, not sure why these changes wouldnt be committed to main from angel one's side as it is a pretty major procedural change

                                        punit 1 Reply Last reply Reply Quote 0
                                        • B
                                          babitakundu @punit last edited by

                                          @Ashok yes I saw the changes but then also I am getting the same error.

                                          M 1 Reply Last reply Reply Quote 0
                                          • A
                                            aj_Brk @admin last edited by

                                            @ivar i don't think you need to paas totp everytime. I tested get profile and other apis. It is working like before. Only login has changes.

                                            I 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post