[cas-user] Re: CAS5.3, SSO between native Mobile App and Web App

2021-05-14 Thread Andy Ng
Hi Omer,

Thanks for reaching out, I do not mind sharing my experience. However if I 
am sharing anything related to CAS, I prefer to share it on this group so 
it can act as reference to all the members, not just particular teams :) So 
I instead of verbal discussion, I would like to be in text and share in 
here.

After looking back to the email conversation, I think I already said all 
the generic information about our mobile to web integration, which is the 
use of AppAuth and not use WebView. Maybe you have specific question you 
would like to ask? If so, you can put all question you would like to ask 
here, so me (and other member) can add our insight on the matter when we 
are free.

Cheers!
- Andy

*P.S. CAS 5.3 is already 
EOL 
https://apereo.github.io/cas/developer/Maintenance-Policy.html#eol-schedule, 
i.e. if you encounter issue with CAS 5.3 it would not be fix. You should 
consider an upgrade to CAS 6.x asap.*

On Friday, 14 May 2021 at 23:26:38 UTC+8 omatary wrote:

> Hi Andy,
> I wonder if you have few minutes to talk about your integration?.   At 
> Rutgers , our Portal team is working on building a mobile app and they  
> need to establish SSO with CAS so that users can access other applications 
> without the need to re-authenticate .
>
> If you are available , I will have one of my IdM and Portal engineers to 
> talk to you .  We are using CAS 5.3 .
>
> My University email address is "oalm...@oit.rutgers.edu" 
>
> Much appreciated .
>  
> Regards,
> Omer AlMatary
>
> On Thursday, April 11, 2019 at 10:02:52 PM UTC-4 Andy Ng wrote:
>
>> Hi Yan,
>>
>> We have built something like this before, 
>>
>> And the answer is: yes you can! When user login to webapp using CAS 
>> protocol, they can SSO to their native app.
>>
>> However some implementation is needed, I can give you some information on 
>> this:
>> - So achieve this, you would want the native app to *not use WebView* to 
>> open browser, instead us Chrome Custom Tab for Android / Safari View 
>> Controller for iOS
>> - it is quite complicated to setup the Chrome custom tab or Safari View 
>> Controller yourself, so I recommend using the AppAuth library (supported by 
>> Google) instead:
>>- AppAuth iOS: https://github.com/openid/AppAuth-iOS
>>- AppAuth Android: https://github.com/openid/AppAuth-Android
>> - The behavior is like the below:
>>- When user login to your app, it will pop up a in-app browser inside 
>> the app (instead of redirecting to the outside browser / instead of using 
>> webview)
>>- Since user already login, CAS will redirect to the redirect_uri, so 
>> this screen will flash for a sec
>>- The in-app browser then will be closed, and AppAuth library will 
>> handle the rest of the login.
>>
>> In the case where user it not login yet, CAS login screen will be shown, 
>> and the flow will be the same after user authenticate successfully
>>
>> See if the above helps you.
>>
>> Cheers!
>> - Andy
>>
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/5adddfab-3e4b-4529-8891-56399540e659n%40apereo.org.


[cas-user] Re: Trouble CAS 6.3.x autowire JPA Repository Beans

2021-05-14 Thread Yan Zhou
I figured out before I was about to give up.  All I had to do is:   
-Dspring.index.ignore=trueadd this to startup script.  

Spring 5 has this new feature that CAS builds on, it won’t load JPA 
repository beans unless one of its modules has it included in 
META-INF/spring.components

 Once I understood that, I can follow CAS framework to get it done without 
using that flag.  

On Thursday, May 13, 2021 at 9:55:00 PM UTC-4 Pablo Vidaurri wrote:

> I assume you are also using
> org.springframework.boot:spring-boot-starter-data-jpa
>
> or is there a special CAS dependency to use instead?
>
> On Thursday, May 13, 2021 at 5:42:23 PM UTC-5 Yan Zhou wrote:
>
>> Hello,
>>
>> I am about to give up, and stay with jdbcTemplate.  I am unable to get 
>> Spring JPA Data Repository to work with CAS 6.4 snapshot.
>>
>> This is my CasWebApplication, everything about data repository is 
>> enabled. But there is no indication in logs that data-jpa autoConfiguration 
>> is taking place. 
>>
>> @SpringBootApplication(
>> scanBasePackages  = {"org.apereo.cas", "com.quest.cas"}, 
>> exclude = {
>> GroovyTemplateAutoConfiguration.class
>> }, 
>> proxyBeanMethods = false)
>> @EnableJpaRepositories(basePackages = {"com.quest.cas.prs.model"})
>> @EntityScan(basePackages =  {"com.quest.cas.prs.model"})
>> @EnableConfigurationProperties(CasConfigurationProperties.class)
>> @EnableAsync
>> @EnableAspectJAutoProxy(proxyTargetClass = true)
>> @EnableTransactionManagement(proxyTargetClass = true)
>> @EnableScheduling
>> @NoArgsConstructor
>> @Slf4j
>> public class CasWebApplication {
>> 
>>
>> There must be something preventing Data repository running, see below for 
>> some conditions from Spring,  I think my runtime environment should allow 
>> it to run, but it does not. 
>>
>> @Configuration(proxyBeanMethods = false)
>> @ConditionalOnBean(DataSource.class)
>> @ConditionalOnClass(JpaRepository.class)
>> @ConditionalOnMissingBean({ JpaRepositoryFactoryBean.class, 
>> JpaRepositoryConfigExtension.class })
>> @ConditionalOnProperty(prefix = "spring.data.jpa.repositories", name = 
>> "enabled", havingValue = "true",
>> matchIfMissing = true)
>> @Import(JpaRepositoriesRegistrar.class)
>> @AutoConfigureAfter({ HibernateJpaAutoConfiguration.class, 
>> TaskExecutionAutoConfiguration.class })
>> public class JpaRepositoriesAutoConfiguration {
>>
>> Yan
>>
>>
>> On Wednesday, May 12, 2021 at 2:33:07 PM UTC-4 Pablo Vidaurri wrote:
>>
>>> Having same problem with the autowire of the repository annotated class. 
>>> Any help would be appreciated.
>>>
>>> -psv
>>>
>>> On Tuesday, May 11, 2021 at 8:43:05 AM UTC-5 Yan Zhou wrote:
>>>
 Hello,

 CAS uses Spring JdbcTemplate, it does not use Spring JPA Data 
 Repository. I was able to easily add that in CAS 5.3, but run into 
 difficulty with CAS 6.3.

 The Spring JPA Data Repository allows me to define interface and Spring 
 provides beans that implement them and Spring cares for all the injection. 
  
  In Cas 6.3, I keep getting error: NoSuchBeanDefinition, in other words, 
 Spring did not instantiate beans for repository interfaces as it should. 

 I believe all my Spring Data Repository configuration is correct and 
 that is why it is working in CAS5.3, such as the spring-data-jpa 
 dependencies, specifying packages for @EnableJpaRepository, @EntityScan in 
 a @Configuration class. 

 Here is CAS 5.3. I can see Spring is instantiating beans for repository 
 interfaces, but this is not happening in CAS 6.3

 Did the wiring and bean instantiation change in cas 6.3?

 Thanks,
 Yan

 2021-05-11 02:00:29,041 DEBUG 
 [org.springframework.beans.factory.support.DefaultListableBeanFactory] - 
 >>> org.springframework.beans.factory.support.DefaultListableBeanFactory@66345a4f:
  
 defining beans  . (some of them are the JPA Data Repository 
 beans)

>>>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/de63b4c5-e238-4489-a9b8-20075418eff1n%40apereo.org.


[cas-user] Re: CAS5.3, SSO between native Mobile App and Web App

2021-05-14 Thread omatary
Hi Andy,
I wonder if you have few minutes to talk about your integration?.   At 
Rutgers , our Portal team is working on building a mobile app and they  
need to establish SSO with CAS so that users can access other applications 
without the need to re-authenticate .

If you are available , I will have one of my IdM and Portal engineers to 
talk to you .  We are using CAS 5.3 .

My University email address is "oalma...@oit.rutgers.edu" 

Much appreciated .
 
Regards,
Omer AlMatary

On Thursday, April 11, 2019 at 10:02:52 PM UTC-4 Andy Ng wrote:

> Hi Yan,
>
> We have built something like this before, 
>
> And the answer is: yes you can! When user login to webapp using CAS 
> protocol, they can SSO to their native app.
>
> However some implementation is needed, I can give you some information on 
> this:
> - So achieve this, you would want the native app to *not use WebView* to 
> open browser, instead us Chrome Custom Tab for Android / Safari View 
> Controller for iOS
> - it is quite complicated to setup the Chrome custom tab or Safari View 
> Controller yourself, so I recommend using the AppAuth library (supported by 
> Google) instead:
>- AppAuth iOS: https://github.com/openid/AppAuth-iOS
>- AppAuth Android: https://github.com/openid/AppAuth-Android
> - The behavior is like the below:
>- When user login to your app, it will pop up a in-app browser inside 
> the app (instead of redirecting to the outside browser / instead of using 
> webview)
>- Since user already login, CAS will redirect to the redirect_uri, so 
> this screen will flash for a sec
>- The in-app browser then will be closed, and AppAuth library will 
> handle the rest of the login.
>
> In the case where user it not login yet, CAS login screen will be shown, 
> and the flow will be the same after user authenticate successfully
>
> See if the above helps you.
>
> Cheers!
> - Andy
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/bb73ac41-e1e7-4f73-9d30-a4b9da980e41n%40apereo.org.