It doesn't look like it. The way that viya system's configured, it not only requires a unique authcode every time you connect, but the url for getting the code is a different one every time also, so you're forced to have to try to connect, get the unique url and then provide the code that you get from that. This has nothing to do with saspy (though I support it as a connection mechanism), it's viya that's configured this way as the only way to connect to it.
Previously when they came up with this authcode scheme, the URL was fixed, so you could at least go get the code and then pass it in on the SASsession call as below. But now it uses a PKCE URL which is required and precludes being able to even know the url to get a code from because the url changes every time, just like the code. It's all in the name of security it seems. And yes, it's no fun, but I can't fix that. If they enables user/pw authentication, you could have used your creds in an authinfo file and it would just connect you like you (anyone) want(s). But that's not allowed, only the PKCE authcode scheme.
>>> sas = saspy.SASsession(cfgname='vft', authcode='VhZSA1xZVOskqT8aMWeu4gMEyGO7ZEiq') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/tom/github/saspy/saspy/sasbase.py", line 598, in __init__ self._io = SASsessionHTTP(sascfgname=self.sascfg.name, sb=self, **kwargs) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 751, in __init__ self.sascfg = SASconfigHTTP(self, **kwargs) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 518, in __init__ js = self._authenticate(user, pw, authcode, client_id, client_secret, jwt, cv) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 623, in _authenticate raise SASHTTPauthenticateError(msg) saspy.sasexceptions.SASHTTPauthenticateError: Failure in GET AuthToken. A PKCE URL is configured to be used to acquire an authcode with is system, but a non-PKCE authcode was passed in. Failure in GET AuthToken. >>> sas = saspy.SASsession(cfgname='vft', authcode='IOBhsXdPFv4P1LvWUZcFLqCAZKgCNzzN') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/tom/github/saspy/saspy/sasbase.py", line 598, in __init__ self._io = SASsessionHTTP(sascfgname=self.sascfg.name, sb=self, **kwargs) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 751, in __init__ self.sascfg = SASconfigHTTP(self, **kwargs) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 518, in __init__ js = self._authenticate(user, pw, authcode, client_id, client_secret, jwt, cv) File "/opt/tom/github/saspy/saspy/sasiohttp.py", line 623, in _authenticate raise SASHTTPauthenticateError(msg) saspy.sasexceptions.SASHTTPauthenticateError: Failure in GET AuthToken. A PKCE URL is configured to be used to acquire an authcode with is system, but a non-PKCE authcode was passed in. Failure in GET AuthToken. >>>
... View more