Comments (7)
I assume it is to ensure that there is only one token stored for each user/organisation at any time. If you look at the two example token stores (MemoryTokenStore and SqliteTokenStore) you can see how the examples would work together. It is just an example remember, and shows one way of authenticating an MVC application and can be modified to fit your solution accordingly
from xero-net.
Yes but line 52 has just tried to find a token in the store and failed. So there is nothing to Delete at line 70.
I am having a frustrating time implementing my use of this Xero API wrapper as it feels very convoluted. I have to create a lot of code to get this thing up and running, rather than just using a pre-built SDK. And when I find something like this in the example code that makes no sense it just increases my unease with this library.
from xero-net.
And why delete the requestToken
on line 60 immediately after finding it. This make no sense to me.
from xero-net.
Yeah you're correct that the delete on line 70 does seem to be redundant. I'll make sure to remove it in the next update. If you come across any other issues, feel free to open up a pull request with fixes.
In regards to deleting the request token on line 60...
A request token is a one use token which is swapped out for an access token. Once you have pulled it out of the _requestTokenStore it no longer needs to be there as the following few lines will invalidate it for future use, so we delete it from the store. It is no longer in the store, but is still held in the local variable ready to be swapped for the access token.
If you havn't already, take a look at our docs for an outline on the authentication flow and steps involved: http://developer.xero.com/documentation/getting-started/public-applications/
from xero-net.
Ahh, right I see that's why you're deleting it. Unfortunately though the PartnerMvcAuthenticator inherits from the PublicMvcAuthenticator, and Partner applications require the original Request Token whenever the Access Token is renewed. This functionality hasn't been overridden in the PartnerMvcAuthenticator. I am currently implementing a Partner App using this new library, hence my confusion.
from xero-net.
You don't nee the original request token to renew a partners access token, you need the original session handle & last access token. Does this help?
from xero-net.
The redundant line will be removed and a comment on the request token removal has been added in #83 This will hopefully help others in the future
from xero-net.
Related Issues (20)
- Get invoice URL using XeroCoreApi HOT 2
- Contact.BatchPayments. Only BankAccountNumber is persisted HOT 1
- BatchPayments PaymentDate set incorretly. HOT 1
- VOIDED BankTransactionStatus is missing HOT 1
- OFFICE PhoneType is missing HOT 1
- Get files from a folder by folder id HOT 1
- TFN changes for Australian Payroll
- When 504 happened, SDK can't throw exception correctlly HOT 1
- Invoice pre/over payments are not exposing `AppliedAmount`
- Deprecated in favour of Xero-NetStandard? HOT 1
- oauth_problem=consumer_key_unknown HOT 1
- oauth_problem=consumer_key_unknown for OAuth 2.0 App HOT 2
- Can we use this library with OAUTH 2.0 ? HOT 1
- Implement new Quotes API HOT 3
- Method issue. HOT 1
- Add support for LineItem.DiscountAmount HOT 1
- Unable to update line item without using reflections HOT 2
- PDF attached as related files not as included files. HOT 1
- Unit DP 4 digits HOT 1
- Using Xero-Net with Auth 2.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xero-net.