{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Microgateway /
avatar image
0
Question by Geir Sjurseth · Oct 06, 2015 at 06:45 AM · 3k Views jwt tokens authentication

What's the process for renewing bearer tokens when they expire?

If the token expires and the client gives you a 401 .. What's the process for renewal? Is it possible to renew via query to the agent directly? Or do you have to rerun the process for genenration on the commandline?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

2 Answers

  • Sort: 
avatar image
1

Answer by Prabhat Jha · Oct 06, 2015 at 09:15 PM

One of the reasons you get to deploy JWT app to your org is so that you can modify it to have your own expiryTime or your own credentials verification. Currently it does not have functionality to refresh token.

What would be advantage of exposing JWT end point through EdgeMicro other than one less URL that client has to know about?

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by seshi · Oct 06, 2015 at 06:56 AM

Hi @Geir Sjurseth

When a token is issues, you would get expires_in value in no.of seconds. You can use this value to decide to request for a new token or not. Renewing the same token wouldn't be feasible once issues with certain expiry time.

"token_type": "BearerToken", "expires_in": "3599",

For more info, can you let me know the Oauth grant type you are implementing.

Thanks, Seshi

Comment
Add comment Show 2 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Geir Sjurseth ♦ · Oct 06, 2015 at 07:00 AM 0
Link

Hi @seshi,

So when I fetch the token using the command line like so:

./edgemicro token get -o geirsjurseth -e test -i <client_id> -s <client_secret>

I don't see an expiry. In fact, if I take that resulting token and check it on jwt.io it decrypts part of it, but then tells me it's invalid (not sure whether that's relevant). But even if I do... How do I rewnew with edgemicro? Is there an endpoint for doing that on the agent? Or would I need to rerun the commandline. When I looked in the code I could see that it was ultimately connecting to cloud on config[authUri]/token to get the info... That authUri, I assume, is coming from the default.yaml.

Is there another way?

/geir

avatar image seshi ♦ Geir Sjurseth ♦ · Oct 06, 2015 at 08:50 AM 0
Link

Thanks for clarifying. @Prabhat Jha can you please provide your inputs.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to obtain a JWT bearer token via curl 1 Answer

edgemicro-auth returns malformed JWT (if multiple products), causes api calls to be rejected. 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges