C# or vb connect to OKTA API

I got there in the end. It’s so hard to find examples and so many examples are very complex. It was very simple in the end:

        Try

            Dim t As String = "my okta api key"

            Dim h As New http

            h.AddHeader("Authorization", "SSWS " & t)

            Dim s As String = h.HTTPGetNet("https://dev-xxx-admin.okta.com/api/v1/users", "application/json")

            Console.WriteLine(s)

            Console.ReadLine()

        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
        End Try

http is a simple local class to do http gets, and could be replaced with webclient or whatever

2 Likes