cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
956
Views
0
Helpful
0
Replies

SMA ASyncOS API

Travis.Lange
Beginner
Beginner

I'm trying to write some automated processes for my SMA using API and PowerShell. I've already figured out how to do everything I need to do my question is about Authentication. 

 

So all of the functions and processes I've written are using Basic authentication because that's I could get to work based on the API document. The document talks about authenticating with a JWT token but never actually goes in to detail on how. So I've built a packet based on what I know about JWT tokens and fired it at the SMA only to be returned a 401. 

 

looking at the API logs I see 

 

Info: Got token issued by: None
Debug: Error: Permission Denied. Reason: Untrused issuer None
Info: User None not authorized

but if I decode the token it looks correct

 

 

{"alg":"HS256","typ":"JWT"}{"userName":"user","is2FactorCheckRequired":false,"cookie":"longCOOKIE"}

 

 

I'm building the header with 

@{Authorization="Bearer $($auth.data.jwtToken)";Accept='application/json'}

Either I'm missing something in my packet or jwttokens aren't actually accepted ways to authenticate to SMA? I'm running ASyncOS 14.0.0-404.

 

I would really like to switch from making all my calls basic where I'm transferring username:password in base64 encoding.

0 Replies 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: