Cannot Get Access or Id Token

When I am authenticating my user, I can successfully do this, but when I try to retrieve the id or access tokens, it fails. I am brand new to Okta and just trying to get this to work. I am sure it is some configuration I am doing incorrectly, but need assistance, please!


oktaAuth.signIn({ username:, password: user.password })
.then(function (transaction) {
if (transaction.status === “SUCCESS”) {
responseType: [‘id_token’, ‘token’],
sessionToken: transaction.sessionToken,
scopes: [“openid”, “email”, “profile”, “address”, “phone”]
.then(function (tokenOrTokens) {
var token = tokenOrTokens[1];
console.log("AccessToken: " + token.accessToken);
$window.localStorage[“auth”] = angular.toJson({
“sessionToken”: transaction.sessionToken,
“user”: transaction.user
oktaAuth.session.setCookieAndRedirect(transaction.sessionToken, ‘https://localhost:44376/Home/AuthMain’);
//$window.location.href = ‘/Home/AuthMain’;

The sign in is a success, but when it gets to the then function, it fails, saying

browser-ponyfill.js:516 POST 400 (Bad Request)

Can you please tell me the proper method to retrieve an access token is?

Thank you,


Hi @wrikgee

What is the 400 error message that you are receiving from Okta on /api/v1/authn, based on the network logs inside the browser?