Implement Login in a Next.js App Functionality by Authorizing with Symbl

Vladimir Novick
InstructorVladimir Novick
Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated 3 years ago

In this video lesson you will implement Login functionality by using Symbl oauth2 endpoint. You will be able to retrieve an access token, that you can use to authorize your REST API calls when calling Symbl APIs

Vladimir Novick: [0:00] To get an appId and appSecret, we need to go to Symbl platform dashboard. We can log in at Symbl Signup and we'll be immediately on this dashboard. We can see our current trial balance for Voice API and Text API. We can also get our credentials.

[0:18] We'll use these credentials to create token using Symbl oauth2 API. We would use token and setToken in our state. Let's switch isLoggedIn from being hardcoded false to being isLoggedIn = token.

[0:38] Let's create a login function. We'll call Symbl endpoint. Passing POST the method, and headers will be Content-Type of application/json. We'll also need to set up mode cors. We'll pass body of appId and appSecret, as well as type application.

[1:28] Then we'll parse the result json and set out token to be accessToken returned from Symbl endpoint. The endpoint that we need to use to authorize the symbol is api.symbl.ai/oauth2/token:generate. Let's log token to the console. Also add onClick handler for our button to do the login.

[2:11] Let's copy our appID, copy the appSecret, log in. As you can see, I have the access token here, and we also have the video processing app rendered.

egghead
egghead
~ 19 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today