我在网站上有一个链接,允许用户向他们的Google日历添加ICS Feed。使用此代码:
http://www.google.com/calendar/render?cid=https://<etc>
它工作了3 - 4年但现在已经不行了。 Google发给我的消息是:
This email address isn't associated with an active Google Calendar account: https://<etc>
如果我手动输入ics feed,那么工作正常:Feed应该按原样解析。没有错误。
知道在哪里解决这个问题吗?
答案 0 :(得分:4)
我也有这个问题。你解决了吗?
我的测试表明,当使用 http 的网址时,它可以正常工作,例如:
www.google.com/calendar/render?cid=http%3A%2%2Fwww.example.com%2FCalendar%2FPublic%2520Events.ics
但不 https ,例如:
www.google.com/calendar/render?cid=https%3A%2%2Fwww.example.com%2FCalendar%2FPublic%2520Events.ics
我的解决方法是在链接中使用http,但在Web服务器中将其重定向到https。不是很优雅,但它的工作原理。 GET不会被加密,但至少答案是。
编辑:实际上,如果您不再通过查询字符串参数进行身份验证,那么通过http而不是https发送GET可能会带来巨大的安全风险,这可能很难用于日历Feed。任何可以嗅探GET的人都可以通过https发送相同的请求。
答案 1 :(得分:1)
现在即使使用@Mock
private AccountReader accountReader ;
@InjectMocks
private SubscriberComponent subscriberComponent;
@Test
public void readAccountCallsAccountReaderForEachIds() throws Exception {
// I have to define accIds here to call my method. but I want the generic way to call my method below
List<String> accIds = new ArrayList<String>();
accIds.add("12333441");
accIds.add("12333442");
accIds.add("12333443");
String name = "NAME" ;
//setup
when(accountReader.readAccount(anyString(),anyString(),eq(Subscriber.class))).thenReturn(subscriber);
when(subscriber.getPlan()).thenReturn(plan);
//execute
//subscriberComponent.readAccount(name,accIds); --- HERE I want to call something like
subscriberComponent.readAccount(anyString(),anyListOf(String.class));
//verify
assertEquals(3,subscriberComponent.readAccount(name,accIds).size() );
verify(accountReader, times(3)).readAccount(anyString(),anyString(), eq(Subscriber.class));
}
也可以。
https
答案 2 :(得分:0)
他们变得更加严格。 现在你必须使用
http://www.google.com/calendar/render?cid=http%3A%2F%2Fwww.example.com%2FCalendar%2FPublic%2520Events.ics
请注意编码。
答案 3 :(得分:0)
使用webcal
协议作为日历地址:
https://www.google.com/calendar/render?cid=webcal%3A%2F%2Fwww.example.com%2FCalendar%2FPublic%20Events.ics
答案 4 :(得分:0)
好,对我来说,此页面上的其他答案均无效。但我想出了一点点其他解决办法:
链接到我的日历的ics:
https://example.com/calendar?id=a304036ea5a474ee5d80a100d79c231c
将其链接到Google日历的正确方法:
https://calendar.google.com/calendar/r?cid=webcal%3A%2F%2Fexample.com%2Fcalendar%3Fid%3Da304036ea5a474ee5d80a100d79c231c
此处的关键是使用 webcal 协议而不是 https 协议添加它。
希望这对任何人都有帮助。