PDA

View Full Version : Access Token expiration for LinkedIn Provider



Hunger
Dec 10th, 2010, 11:27 AM
Hi,
I have a problem with LinkedIn site. I configured Spring OAuth and everything seems fine, except that, requested access token is returned with additional parameter oauth_expires_in=0. So token service don't store it, it treats it as expired token. So why it is already expired? Is it a bug or I miss something?
Here is my config:


<bean id="oauthConsumerProcessingFilter" class="org.springframework.security.oauth.consumer.OAuthC onsumerProcessingFilter">
<property name="consumerSupport">
<bean class="org.springframework.security.oauth.consumer.CoreOA uthConsumerSupport">
<property name="protectedResourceDetailsService" ref="protectedResourceDetailsService"/>
</bean>
</property>
<property name="protectedResourceDetailsService" ref="protectedResourceDetailsService"/>
<property name="objectDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/linkedin/**=linkedInResources
</value>
</property>
</bean>

<bean id="protectedResourceDetailsService" class="org.springframework.security.oauth.consumer.InMemo ryProtectedResourceDetailsService">
<property name="resourceDetailsStore">
<map>
<entry key="linkedInResources" value-ref="linkedInResources"/>
</map>
</property>
</bean>

<bean id="linkedInResources" class="org.springframework.security.oauth.consumer.BasePr otectedResourceDetails">
<property name="id" value="linkedInResources"/>
<property name="consumerKey" value="public key"/>
<property name="sharedSecret">
<bean class="org.springframework.security.oauth.common.signatur e.SharedConsumerSecret">
<constructor-arg value="mysecrete here"/>
</bean>
</property>
<property name="requestTokenURL" value="https://api.linkedin.com/uas/oauth/requestToken"/>
<property name="accessTokenURL" value="https://api.linkedin.com/uas/oauth/accessToken"/>
<property name="userAuthorizationURL" value="https://www.linkedin.com/uas/oauth/authorize"/>
<property name="signatureMethod" value="HMAC-SHA1"/>
</bean>

Unfortunately, I wired up with Spring security 2.0.3 and Spring 2.5.6, so I use
org.codehaus.spring-security-oauth, version 3.19.
Can anybody help me?